LukeChannings/moviematch

Engage button not working with HTTPS

Closed this issue · 3 comments

I set this up with my Nginx reverse proxy. It works fine when accessed locally, but when accessed externally (https), the Engage button doesn't do anything. Not sure if this is an issue with my Nginx setup for this, the app, or potentially the Plex server address in the docker run. That should just be the local address for Plex, right?

I just pulled the latest image to be safe, same issue. Docker log shows:

ERROR Error: request is not acceptable
at acceptWebSocket (mod.ts:437:9)
at WebSocketServer.connect (websocketServer.ts:38:26)
at index.ts:21:9

You need to add a location block in your nginx config that allows for websockets to be passed. Here's the relevant part of my config:

location /ws {
        include /config/nginx/proxy.conf;
        proxy_pass http://IP_ADDRESS:PORT;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
}

Be sure to replace IP_ADDRESS and PORT with the actual values of the running app

Thanks, appears to be working now. In case anyone runs into a similar issue, this is what the relevant portion of my Nginx config looks like:

    # Proxy to MovieMatch
    location / {
        proxy_set_header X-Real-IP         $remote_addr;
        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Forwarded-Host  $http_host;
        proxy_set_header Host              $http_host;
        proxy_max_temp_file_size           0;
        proxy_pass                         http://localhost:8000;
        proxy_redirect                     http:// https://;
    }

    # Need to allow websockets to be passed for Engage button to work 2020-12-10
    location /ws {
        proxy_pass http://localhost:8000;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }