Skip to content

Instantly share code, notes, and snippets.

@lalizita
Created July 19, 2022 21:55
Show Gist options
  • Save lalizita/de5b1b8471ab7a3e02472c625af6db34 to your computer and use it in GitHub Desktop.
Save lalizita/de5b1b8471ab7a3e02472c625af6db34 to your computer and use it in GitHub Desktop.
events{
worker_connections 1024;
}
http {
# A shared memory zone to keep cache
proxy_cache_path /etc/nginx/cache keys_zone=mycache:10m inactive=10m;
server {
listen 8080;
location / {
proxy_pass http://server:8082;
proxy_cache mycache;
add_header X-Cache-Status $upstream_cache_status;
proxy_cache_valid 200 10s;
proxy_cache_key $host$uri$is_args$args;
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
#Bypass rule
proxy_cache_bypass $cookie_nocache $arg_nocache$arg_comment;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment