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

Websocket auf domain port 80 legen #42

Open
MatthiasHertel opened this issue Jan 30, 2017 · 0 comments
Open

Websocket auf domain port 80 legen #42

MatthiasHertel opened this issue Jan 30, 2017 · 0 comments
Labels

Comments

@MatthiasHertel
Copy link
Owner

MatthiasHertel commented Jan 30, 2017

problem:

hinter einer firewall (eg uni wlan) werden nur ports 80 bzw 443 aufgemacht ...
der chat sollte ueber eine subdomain erreichbar sein und intern von nginx geroutet werden auf den nodejs port

loesung:

nginx reverse proxy

websocket upgrade fuer http in nginx
https://www.nginx.com/blog/websocket-nginx/

http {
    map $http_upgrade $connection_upgrade {
        default upgrade;
        '' close;
    }

    upstream websocket {
        server localhost:1337;
    }

    server {
        listen 80;
        location / {
            proxy_pass http://spaceinvaders-chat.mhertel.de
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $connection_upgrade;
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant