Alternative Servers

Hello,

I am currently running one instance on a PI, connected to my printer and wanted to add a second instance with more computing power. Both instances are running behind a reverse proxy with a dedicated domain, using https with Let's Encrypt certificates and the web interface works fine for both instances. Unfortunately adding the alternative server results in "Server is not reachable!" although the name, API key, domain name and port should be fine. 

Does this feature need a special Port or is the connection handled differently than with the web interface? I couldn't find any information on that in the documentation :/ Both instances are running Repetier Server Pro 1.4.9

Thanks in advance! 

Comments

  • Are you using 2 subdomains for it? UI expects to be located at / and a proxy to port 3344 is all you need. But there is the issue of websockets. All sockets are under /socket and need a special proxy for ws or wss if using https. See
    https://www.repetier-server.com/webserver-access-repetier-server/
    how it would look like for nginx. For apache I guess it would be proxy with special handling of /socket path.
  • Yes, I am using 2 different subdomains, e.g. "repetier1.domain.com" and "repetier2.domain.com"

    I am using Traefik as a proxy. It should already be able to handle ws/wss connections by default, but I also tried setting the headers manually which you provided. Both unfortunately don't work.
    The Chrome dev tools also say that the connection to the web socket is working (for the UI) and messages are being sent over it (applies to both instances).

    Here is my Traefik config for the routing to the raspi. The config for the other instance is mostly similar, only a few entries changed, since it is running on the same machine as the proxy. Note: The configuration for the UI was already working for the "printer" setup. After you answered, I also added the "printer-wss" setup but that apparently also doesn't work.

    ```yml
    http:
      routers:
        printer:
          rule: Host(`repetier1.domain.com`) && !PathPrefix(`/mod/front`) && !PathPrefix(`/modules/front2`)
          service: printer
          entrypoints: websecure
          tls:
            certresolver: le
        printer-wss:
          rule: Host(`repetier1.domain.com`) && PathPrefix(`/socket/`)
          service: printer-wss
          entrypoints: websecure
          tls:
            certresolver: le

      services:
        printer:
          loadBalancer:
            servers:
              - url: "http://192.168.2.157:3344"
        printer-wss:
          loadBalancer:
            servers:
              - url: "http://192.168.2.157:3344/socket/"
    ```

  • I don't know Traefik, but is order important here? I note socket is last and not an exception to printer rule.

    Actually if you see first page forwarding is working. If you can not login or info stays empty it is the socket having issues.

    Also socket forwarding looks wrong. In your case zou have incoming wss:// protocol and must forward to ws:// protocol for /socket.
Sign In or Register to comment.