Skip to content

Instantly share code, notes, and snippets.

@jbutko
Created June 9, 2017 08:43
Show Gist options
  • Save jbutko/5f273d583f2d0bc287cea645601dcc9b to your computer and use it in GitHub Desktop.
Save jbutko/5f273d583f2d0bc287cea645601dcc9b to your computer and use it in GitHub Desktop.
Nginx: Forward socket requests runing behind proxy
# websocket connections need routing to the real-time-sharelatex service,
# running at localhost:3026 by default.
location /socket.io {
proxy_pass http://localhost:3026;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_x_forwarded_host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 3m;
proxy_send_timeout 3m;
}
# via https://github.com/sharelatex/sharelatex/issues/226#issuecomment-64882027
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment