Advertisement
Guest User

full2

a guest
Aug 3rd, 2012
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. server
  2. {
  3. listen 80 default;
  4.  
  5. server_name .domain.com;
  6. access_log off;
  7. #access_log /var/log/nginx/domain.com.access.log;
  8. error_log /var/log/nginx/domain.com.error.log;
  9. index index.php index.html index.htm;
  10. client_max_body_size 300M;
  11. #client_body_buffer_size 128k;
  12.  
  13. root /var/www/domain.com/html;
  14. expires 0;
  15.  
  16.  
  17. location / {
  18. try_files $uri $uri/ /index.php;
  19.  
  20. # down page
  21. if (-f $document_root/down.html) {
  22. return 503;
  23. }
  24. }
  25.  
  26.  
  27. location ^~ /progress {
  28. # report uploads tracked in the 'proxied' zone
  29. report_uploads proxied;
  30. }
  31.  
  32.  
  33.  
  34. location = /favicon.ico {
  35. log_not_found off;
  36. access_log off;
  37. }
  38. location = /robots.txt {
  39. allow all;
  40. log_not_found off;
  41. access_log off;
  42. }
  43.  
  44. # removes trailing "index" from all controllers
  45. if ($request_uri ~* index/?$)
  46. {
  47. rewrite ^/(.*)/index/?$ /$1 permanent;
  48. }
  49.  
  50. # removes trailing slashes (prevents SEO duplicate content issues)
  51. if (!-d $request_filename)
  52. {
  53. rewrite ^/(.+)/$ /$1 permanent;
  54. }
  55.  
  56. # use fastcgi for all php files
  57. location ~* \.php$
  58. {
  59. track_uploads proxied 30s;
  60. try_files $uri /index.php;
  61. fastcgi_pass 127.0.0.1:9000;
  62. fastcgi_index index.php;
  63. fastcgi_read_timeout 600s;
  64. fastcgi_split_path_info ^(.+\.php)(.*)$;
  65. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  66. include fastcgi_params;
  67.  
  68.  
  69. }
  70.  
  71. # enforce NO www
  72. if ($host ~* ^www\.(.*))
  73. {
  74. set $host_without_www $1;
  75. rewrite ^/(.*)$ http://domain.com/$1 permanent;
  76. }
  77.  
  78.  
  79. # deny access to apache .htaccess files
  80. location ~ /\.ht
  81. {
  82. deny all;
  83. }
  84.  
  85. error_page 503 @maintenance;
  86. location @maintenance {
  87. rewrite ^(.*)$ /down.html break;
  88. }
  89.  
  90.  
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement