Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http {
- proxy_cache_path /var/www/cache levels=1:2 keys_zone=my-cache:8m max_size=1000m inactive=600m;
- proxy_temp_path /var/www/cache/tmp;
- server {
- location / {
- proxy_pass http://example.net;
- proxy_cache my-cache;
- proxy_cache_valid 200 302 60m;
- proxy_cache_valid 404 1m;
- }
- }
- }
- proxy_cache_bypass
- location = /pageid {
- proxy_pass http://localhost:82;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_ignore_headers Set-Cookie;
- proxy_ignore_headers Cache-Control;
- proxy_cache_bypass $http_secret_header;
- add_header X-Cache-Status $upstream_cache_status;
- }
- curl "www.site.com/pageid" -s -I -H "secret_header:true"
- server {
- # Other settings
- proxy_pass_header Set-Cookie; # I want to cache logged-in users
- proxy_ignore_headers X-Accel-Redirect;
- proxy_ignore_headers X-Accel-Expires Expires Cache-Control;
- if ($http_cache_control ~ "max-age=0") {set $eac 1;}
- proxy_cache_bypass $eac;
- }
- proxy_cache
- proxy_cache_valid
- proxy_cache_valid 200 302 10m;
- echo -n ‘httpczerasz.com/time.php’ | md5sum
- rm /data/nginx/cache/1/27/2bba799df783554d8402137ca199a271
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement