Last active
August 29, 2015 14:17
-
-
Save foliea/32d6178eef552856e70f to your computer and use it in GitHub Desktop.
Example
This file contains 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
events { | |
worker_connections ${WORKERS:-1024}; | |
} | |
http { | |
{{#config.websocket.on}} | |
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} | |
{{/config.websocket.on}} | |
{{#config.ssl.on}} | |
server { | |
listen {{config.server.port}}; | |
return 301 https://$host$request_uri; | |
} | |
{{/config.ssl.on}} | |
server { | |
server_name {{config.server.name}}; | |
{{#config.ssl.on}} | |
listen {{config.ssl.port}} ssl; | |
ssl_certificate /certs/cert.pem; | |
ssl_certificate_key /certs/key.pem; | |
{{/config.ssl.on}} | |
{{^config.ssl.on}} | |
listen {{config.server.port}}; | |
{{/config.ssl.on}} | |
proxy_redirect off; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
location / { | |
proxy_pass {{config.web.url}}; | |
proxy_buffering on; | |
} | |
{{#config.websocket.on}} | |
location /{{config.websocket.route}}/ { | |
proxy_pass {{config.websocket.url}}; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection $connection_upgrade; | |
proxy_read_timeout 86400; | |
proxy_ignore_client_abort on; | |
} | |
{{/config.websocket.on}} | |
} | |
} | |
daemon off; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment