Skip to content

Instantly share code, notes, and snippets.

@AugustoCalaca
Created February 22, 2021 22:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AugustoCalaca/8196ef8ed753f734115d84d0df67dcb3 to your computer and use it in GitHub Desktop.
Save AugustoCalaca/8196ef8ed753f734115d84d0df67dcb3 to your computer and use it in GitHub Desktop.
How to config ngnix to use websockets at subscriptions location on server
server {
listen 80;
listen [::]:80;
server_name graphql.mydomain.com.br;
location / {
proxy_pass http://mydomain:8080;
}
location /subscriptions {
proxy_pass http://mydomain:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade websocket;
proxy_set_header Connection Upgrade;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment