Skip to content

Instantly share code, notes, and snippets.

@glagola
Created May 20, 2017 21:23
Show Gist options
  • Save glagola/48cff1726622b54248fb716fd67641fe to your computer and use it in GitHub Desktop.
Save glagola/48cff1726622b54248fb716fd67641fe to your computer and use it in GitHub Desktop.
Cache generated images
server {
listen 80;
server_name server.ru;
location ~* ^/i/([^./]*) {
proxy_ignore_headers Expires Cache-Control;
proxy_cache_lock on;
proxy_cache_valid 24h;
proxy_cache_valid 404 1m;
proxy_cache roommates;
proxy_cache_key "$1-$arg_w-$arg_h";
proxy_pass http://server.ru:8080;
}
location / {
proxy_pass http://server.ru:8080;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment