Created
July 14, 2015 03:19
-
-
Save lfalcao/d1e0ae9ac267605967ff to your computer and use it in GitHub Desktop.
nginx caching thumbor webp/jpg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proxy_cache_path /tmp/nginx levels=1:2 keys_zone=my_zone:10m inactive=60m; | |
proxy_cache_key "$host$request_uri-$format"; | |
server { | |
listen 999; | |
server_name _; | |
set $format jpg; | |
if ( $http_accept ~* 'webp' ) { | |
set $format webp; | |
} | |
location / { | |
proxy_cache my_zone; | |
proxy_pass http://localhost:9000; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment