Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=my_cache:10m
  2. max_size=10g inactive=72h use_temp_path=off;
  3.  
  4. server {
  5. location / {
  6. expires max;
  7.  
  8. resolver 8.8.8.8 ipv6=off;
  9. resolver_timeout 5s;
  10.  
  11. proxy_cache my_cache;
  12. proxy_cache_valid 200 302 301 303 24h;
  13. proxy_cache_key $scheme://$host$request_uri";
  14. proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
  15. proxy_ignore_headers Cache-Control Expires Set-Cookie;
  16.  
  17. set $proxy_host "$http_host";
  18. set $url "$scheme://$http_host$request_uri";
  19. proxy_redirect off;
  20. proxy_set_header Host $proxy_host;
  21. proxy_set_header X-Forwarded-Host $http_host;
  22. proxy_pass "$url";
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement