Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. server {
  2. listen 80;
  3.  
  4. # Site Directory same in the apache virtualhost configuration
  5. root /var/www/html;
  6. index index.php index.html index.htm;
  7.  
  8. # Domain
  9. server_name www.reverse.com reverse.com;
  10.  
  11. location / {
  12. try_files $uri $uri/ /index.php;
  13. }
  14.  
  15. # Reverse Proxy and Proxy Cache Configuration
  16. location ~ \.php$ {
  17.  
  18. proxy_set_header X-Real-IP $remote_addr;
  19. proxy_set_header X-Forwarded-For $remote_addr;
  20. proxy_set_header Host $host;
  21. proxy_pass http://127.0.0.1:8080;
  22.  
  23. # Cache configuration
  24. proxy_cache reverse_cache;
  25. proxy_cache_valid 3s;
  26. proxy_no_cache $cookie_PHPSESSID;
  27. proxy_cache_bypass $cookie_PHPSESSID;
  28. proxy_cache_key "$scheme$host$request_uri";
  29. add_header X-Cache $upstream_cache_status;
  30. }
  31.  
  32. # Enable Cache the file 30 days
  33. location ~* .(jpg|png|gif|jpeg|css|mp3|wav|swf|mov|doc|pdf|xls|ppt|docx|pptx|xlsx)$ {
  34. proxy_cache_valid 200 120m;
  35. expires 30d;
  36. proxy_cache reverse_cache;
  37. access_log off;
  38. }
  39.  
  40. # Disable Cache for the file type html, json
  41. location ~* .(?:manifest|appcache|html?|xml|json)$ {
  42. expires -1;
  43. }
  44.  
  45. location ~ /\.ht {
  46. deny all;
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement