Last active
December 24, 2015 00:19
-
-
Save mrvdb/6715728 to your computer and use it in GitHub Desktop.
nginx configuration for pump.io instance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define our upstream host(s) | |
# Upstream means in this case the port where the pump.io application runs | |
# as it is all on the same machine. | |
upstream pumpbackend { | |
server 127.0.0.1:9999 max_fails=3; | |
} | |
# Only select next_upstream host on error | |
proxy_next_upstream error; | |
# define $connection_upgrade to be either | |
# - 'upgrade' or | |
# - 'close' depending on $http_upgrade value | |
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} | |
# Server block for pump.io | |
server { | |
# Include defaults for server | |
include /etc/nginx/include/server.conf; | |
# Make it trigger to qua.name | |
server_name qua.name; | |
# Mainly for image uploads | |
client_max_body_size 10M; | |
location / { | |
# Default proxy parameters (realip, x-forwarded-for etc.) | |
include /etc/nginx/include/proxy.conf; | |
# Configure in the protocol switch (needs fairly recent nginx) | |
proxy_http_version 1.1; | |
# Make sure the headers are passed on (normally they are not) | |
# using the map above | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection $connection_upgrade; | |
# Go! | |
proxy_pass http://pumpbackend; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment