Last active
May 17, 2018 15:54
-
-
Save bodokaiser/9915462 to your computer and use it in GitHub Desktop.
My current nginx conf: reverse proxy for http and ws protocol
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
events { | |
worker_connections 1024; | |
} | |
http { | |
charset UTF-8; | |
upstream example { | |
server 127.0.0.1:3000; | |
keepalive 32; | |
} | |
proxy_cache_path /var/cache/nginx | |
levels=1:2 | |
max_size=1g | |
inactive=24h | |
keys_zone=default:1m | |
; | |
server { | |
listen 80; | |
server_name example.org; | |
location / { | |
proxy_pass http://example; | |
proxy_cache default; | |
proxy_cache_valid 200 1d; | |
proxy_redirect off; | |
proxy_http_version 1.1; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment