Skip to content

Instantly share code, notes, and snippets.

@rjsamson
Last active August 10, 2016 16:04
Show Gist options
  • Save rjsamson/8be4e631c09ff36b55cbf4f1394b218d to your computer and use it in GitHub Desktop.
Save rjsamson/8be4e631c09ff36b55cbf4f1394b218d to your computer and use it in GitHub Desktop.
stackfooter nginx conf
events {
worker_connections 1024;
}
http {
include /etc/nginx/sites-enabled/*;
}
upstream stackfooter {
server 127.0.0.1:8888;
}
# The following map statement is required
# if you plan to support channels. See https://www.nginx.com/blog/websocket-nginx/
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server{
listen 80;
server_name stackfooter.rjsamson.org;
location / {
try_files $uri @proxy;
}
location @proxy {
include proxy_params;
proxy_redirect off;
proxy_pass http://stackfooter;
# The following two headers need to be set in order
# to keep the websocket connection open. Otherwise you'll see
# HTTP 400's being returned from websocket connections.
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