Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. http {
  2. proxy_cache_path /var/www/cache levels=1:2 keys_zone=my-cache:8m max_size=1000m inactive=600m;
  3. proxy_temp_path /var/www/cache/tmp;
  4.  
  5.  
  6. server {
  7. location / {
  8. proxy_pass http://example.net;
  9. proxy_cache my-cache;
  10. proxy_cache_valid 200 302 60m;
  11. proxy_cache_valid 404 1m;
  12. }
  13. }
  14. }
  15.  
  16. proxy_cache_bypass
  17.  
  18. location = /pageid {
  19. proxy_pass http://localhost:82;
  20. proxy_set_header Host $host;
  21. proxy_set_header X-Real-IP $remote_addr;
  22. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  23. proxy_ignore_headers Set-Cookie;
  24. proxy_ignore_headers Cache-Control;
  25. proxy_cache_bypass $http_secret_header;
  26. add_header X-Cache-Status $upstream_cache_status;
  27. }
  28.  
  29. curl "www.site.com/pageid" -s -I -H "secret_header:true"
  30.  
  31. server {
  32. # Other settings
  33. proxy_pass_header Set-Cookie; # I want to cache logged-in users
  34. proxy_ignore_headers X-Accel-Redirect;
  35. proxy_ignore_headers X-Accel-Expires Expires Cache-Control;
  36. if ($http_cache_control ~ "max-age=0") {set $eac 1;}
  37. proxy_cache_bypass $eac;
  38. }
  39.  
  40. proxy_cache
  41.  
  42. proxy_cache_valid
  43.  
  44. proxy_cache_valid 200 302 10m;
  45.  
  46. echo -n ‘httpczerasz.com/time.php’ | md5sum
  47.  
  48. rm /data/nginx/cache/1/27/2bba799df783554d8402137ca199a271
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement