Skip to content

Instantly share code, notes, and snippets.

@caquino
Last active April 12, 2018 14:46
Show Gist options
  • Save caquino/a4692d5abefba4141ad6f5e9fa49ee05 to your computer and use it in GitHub Desktop.
Save caquino/a4692d5abefba4141ad6f5e9fa49ee05 to your computer and use it in GitHub Desktop.
proxy_cache_path /tmp/nginx levels=1:2 keys_zone=default:10m max_size=50m;
upstream backends {
server service.consul service=backend resolve;
}
server {
status_zone default;
listen 80;
server_name _;
add_header X-Cache-Status $upstream_cache_status;
location / {
proxy_cache_valid 200 1m;
proxy_cache default;
proxy_cache_key $uri;
proxy_pass http://backends;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment