Skip to content

Instantly share code, notes, and snippets.

@Jannis
Created July 7, 2020 12:31
Show Gist options
  • Save Jannis/f0264bdd9a71fd3c72d2cda41b6798b1 to your computer and use it in GitHub Desktop.
Save Jannis/f0264bdd9a71fd3c72d2cda41b6798b1 to your computer and use it in GitHub Desktop.
http {
# See http://nginx.org/en/docs/http/websocket.html
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
location ... {
# Proxy configuration.
proxy_pass http://127.0.0.1:8001;
proxy_http_version 1.1;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_cache_bypass $http_upgrade;
# Gateway timeout.
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment