-
-
Save wsaribeiro/2ca303a002e71b84ae86 to your computer and use it in GitHub Desktop.
NGINX cache proxy
This file contains 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
http { | |
proxy_cache_path /tmp/cache levels=1:2 keys_zone=photo-cache:8m max_size=5000m inactive=43829m; | |
proxy_cache_key $host$uri$is_args$args; | |
server { | |
proxy_cache photo-cache; | |
listen 80; | |
server_name cdn.matsimitsu.com; | |
access_log logs/cdn.access.log; | |
location / { | |
expires 365d; | |
add_header Pragma public; | |
add_header Cache-Control "public"; | |
add_header X-Proxy-Cache $upstream_cache_status; | |
proxy_cache_valid 200 43829m; | |
proxy_pass http://localhost:7000; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment