Guest User

nginx

a guest
May 8th, 2015
366
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. server
  2. {
  3. listen 80;
  4. server_name example_site.ru www.example_site.ru;
  5. access_log /var/log/nginx.access_log;
  6.  
  7. location ~* .(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf|flv|html|htm|mp3|docx|xlsx)$
  8. {
  9. root /home/example_site/www.example_site.ru/public_html/;
  10. error_page 404 = @fallback;
  11. index index.html index.php;
  12. access_log off;
  13. expires 30d;
  14. }
  15.  
  16. location ~ /.ht { deny all; }
  17.  
  18. location /
  19. {
  20. proxy_pass http://127.0.0.1:81/;
  21. proxy_set_header X-Real-IP $remote_addr;
  22. proxy_set_header X-Forwarded-for $remote_addr;
  23. proxy_set_header Host $host;
  24. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  25. proxy_connect_timeout 60;
  26. proxy_send_timeout 90;
  27. proxy_read_timeout 90;
  28. proxy_redirect off;
  29. proxy_set_header Connection close;
  30. proxy_pass_header Content-Type;
  31. proxy_pass_header Content-Disposition;
  32. proxy_pass_header Content-Length;
  33. }
  34.  
  35. location @fallback
  36. {
  37. proxy_pass http://127.0.0.1:81;
  38. proxy_set_header Host $host;
  39. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  40. proxy_set_header X-Forwarded-Proto $scheme;
  41. proxy_set_header X-Real-IP $remote_addr;
  42. }
  43. }
RAW Paste Data