Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
divu-nginx-async-nginx.conf
http {
proxy_read_timeout 20;
proxy_cache_path /var/cache/nginx/cache_content levels=1:2 keys_zone=cache_content:10m
inactive=24h max_size=100m;
proxy_cache cache_content;
proxy_cache_valid 200 20s;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
proxy_cache_background_update on;
server {
listen 80;
server_name cache.local.com localhost;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header HOST $http_host;
proxy_pass http://<host-ip-use-ifconfig>:3000;
proxy_redirect off;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header X-Cache-Status $upstream_cache_status;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment