Advertisement
talkingnews

Working nginx

Dec 10th, 2011
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. server {
  2. listen x.x.x.x:80;
  3.  
  4.  
  5. server_name forum.co.uk www.forum.co.uk;
  6.  
  7. root /var/www/forum.co.uk/web;
  8.  
  9.  
  10.  
  11. index index.html index.htm index.php index.cgi index.pl index.xhtml;
  12.  
  13.  
  14.  
  15. error_page 400 /error/400.html;
  16. error_page 401 /error/401.html;
  17. error_page 403 /error/403.html;
  18. error_page 404 /error/404.html;
  19. error_page 405 /error/405.html;
  20. error_page 500 /error/500.html;
  21. error_page 502 /error/502.html;
  22. error_page 503 /error/503.html;
  23.  
  24. error_log /var/log/ispconfig/httpd/forum.co.uk/error.log;
  25. access_log /var/log/ispconfig/httpd/forum.co.uk/access.log combined;
  26.  
  27. ## Disable .htaccess and other hidden files
  28. location ~ /\. {
  29. deny all;
  30. access_log off;
  31. log_not_found off;
  32. }
  33.  
  34. location = /favicon.ico {
  35. log_not_found off;
  36. access_log off;
  37. }
  38.  
  39. location = /robots.txt {
  40. allow all;
  41. log_not_found off;
  42. access_log off;
  43. }
  44.  
  45. location /stats {
  46. index index.html index.php;
  47. auth_basic "Members Only";
  48. auth_basic_user_file /var/www/clients/clientx/web5/.htpasswd_stats;
  49. }
  50.  
  51. location ~ \.php$ {
  52. try_files $uri =404;
  53. include /etc/nginx/fastcgi_params;
  54. fastcgi_pass unix:/var/lib/php5-fpm/web5.sock;
  55. fastcgi_index index.php;
  56. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  57. fastcgi_param PATH_INFO $fastcgi_script_name;
  58. fastcgi_intercept_errors on;
  59. }
  60.  
  61.  
  62. location ~* ^.+\.(jpg|jpeg|gif|png)$ {
  63. access_log off;
  64. expires 30d;
  65. }
  66.  
  67. set_real_ip_from 204.93.240.0/24;
  68. set_real_ip_from 204.93.177.0/24;
  69. set_real_ip_from 199.27.128.0/21;
  70. set_real_ip_from 173.245.48.0/20;
  71. set_real_ip_from 103.22.200.0/22;
  72. set_real_ip_from 141.101.64.0/18;
  73. set_real_ip_from 108.162.192.0/18;
  74. real_ip_header CF-Connecting-IP;
  75. client_max_body_size 28M;
  76. client_body_buffer_size 128k;
  77.  
  78.  
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement