Skip to content

Instantly share code, notes, and snippets.

@gavinzhou
Created December 20, 2016 02:55
Show Gist options
  • Save gavinzhou/2de9d4ade4242606181dffd670987031 to your computer and use it in GitHub Desktop.
Save gavinzhou/2de9d4ade4242606181dffd670987031 to your computer and use it in GitHub Desktop.
nginx-cache-influxdb-query
proxy_cache_path /var/cache/nginx-influxdb levels=2:2 keys_zone=influxdb:6m max_size=300m inactive=2d;
server {
listen 8088;
server_name {{ grains['fqdn'] }};
set $cbypass 0;
set $mycc "public, max-age=20s";
location / {
add_header Cache-Control $mycc;
proxy_pass http://acc2mfcfads.salt.xxx.ca:8086/;
proxy_cache_use_stale timeout updating error invalid_header;
proxy_cache influxdb;
# proxy_cache_valid any 5m;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment