Advertisement
Guest User

Untitled

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