Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx Proxy #203

Open
mnash04 opened this issue Mar 6, 2017 · 2 comments
Open

Nginx Proxy #203

mnash04 opened this issue Mar 6, 2017 · 2 comments

Comments

@mnash04
Copy link

mnash04 commented Mar 6, 2017

Has anyone successfully been able to put a proxy in front of this server?

I'm able to successfully proxy using nginx on port 80 to the back end loowid server on port 80 (no certs)

When I try to proxy using nginx on port 443 (with certs) to the back end loowid server on port 80 (no certs) I get this error:

WebSocket connection to 'wss://backendserver:80/' failed: Error in connection establishment: net::ERR_SSL_PROTOCOL_ERROR

Here is the relevant nginx configuration:

location / {
proxy_pass http://backendserver:80;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}

Thanks.

@juanjmerono
Copy link
Member

I think you need to tell nginx that WebSocket connections to wss://frontend/ must be redirected to ws://backend/. The app is trying to connect using WSS protocol because you are using HTTPS in the front-end, but backend is only listen to HTPP/WS protocols.
Try with something similar to this configuration: http://www.tutorialspoint.com/articles/how-to-configure-nginx-as-reverse-proxy-for-websocket

@mnash04
Copy link
Author

mnash04 commented Mar 7, 2017

I agree.

That configuration didn't work either. I've set up two other similar websocket reverse proxies with nginx and ssl before. This one doesn't want to work though. The main difference is that in this one, there is no separate path like /rooms/ specified, its just " / ". Is there a way people have proxied it with the websocket running on a separate port than 80?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants