Advertisement
Guest User

Untitled

a guest
Jan 28th, 2012
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.84 KB | None | 0 0
  1. server
  2. {
  3. server_name .domain.com;
  4. #rewrite ^ $scheme://domain.com$request_uri permanent;
  5. access_log /var/log/nginx/domain.com.access.log;
  6. error_log /var/log/nginx/domain.com.error.log;
  7. root /var/www/domain.com;
  8.  
  9. index index.php index.html index.htm;
  10. client_max_body_size 10M;
  11. client_body_buffer_size 128k;
  12.  
  13.  
  14.  
  15. location / {
  16. try_files $uri $uri/ /test1/index.php;
  17. #rewrite ^/test1/([A-Za-z0-9]+)?$ /test1/site/view/$1 redirect;
  18.  
  19. #rewrite "/test1/([A-Za-z0-9]+)?" /test1/site/view/$1 break;
  20. #rewrite /test1/$1 ^/test1/site/view/([A-Za-z0-9])?$ break;
  21. #rewrite ^/test1/([A-Za-z0-9])?$ /test1/site/view/$1 break;
  22.  
  23.  
  24. rewrite ^/test1/s_(.+)$ /test1/images/small/$1 break;
  25.  
  26. }
  27.  
  28. #location /test1 {
  29. #rewrite s_^ /test1/images/small/$request_uri? permanent;
  30. #rewrite "/photos/([0-9] {2})([0-9] {2})([0-9] {2})" /path/to/photos/$1/$1$2/$1$2$3.png;
  31. #rewrite ^/(test1/images/small/.*)$ /test1/s_$1 break;
  32. #rewrite ^/(test1/.*)$ /test1/images/small/$1 break;
  33. #rewrite s_^ /test1/images/small/$request_uri? permanent;
  34. #rewrite ^/test1/s_(.+)$ /test1/images/small/$1;
  35. #rewrite ^/test1/(.+)$ /test1/site/view/$1 break;
  36. #}
  37.  
  38.  
  39. location = /favicon.ico {
  40. log_not_found off;
  41. access_log off;
  42. }
  43. location = /robots.txt {
  44. allow all;
  45. log_not_found off;
  46. access_log off;
  47. }
  48.  
  49.  
  50. # phpmyadmin
  51. location ^~ /phpmyadmin {
  52. root /usr/share/;
  53. index index.php index.html index.htm;
  54. location ~ ^/phpmyadmin/(.+\.php)$ {
  55. root /usr/share/;
  56. fastcgi_pass 127.0.0.1:9000;
  57. fastcgi_index index.php;
  58. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  59. include fastcgi_params;
  60. }
  61. location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
  62. root /usr/share/;
  63. }
  64. }
  65. location /phpMyAdmin {
  66. rewrite ^/* /phpmyadmin last;
  67. }
  68.  
  69. ###################
  70.  
  71. # removes trailing "index" from all controllers
  72. if ($request_uri ~* index/?$)
  73. {
  74. rewrite ^/(.*)/index/?$ /$1 permanent;
  75. }
  76.  
  77. # removes trailing slashes (prevents SEO duplicate content issues)
  78. if (!-d $request_filename)
  79. {
  80. rewrite ^/(.+)/$ /$1 permanent;
  81. }
  82.  
  83. # enforce www (exclude certain subdomains)
  84. if ($host !~* ^(www|subdomain|i))
  85. {
  86. rewrite ^/(.*)$ $scheme://www.$host/$1 permanent;
  87. }
  88.  
  89.  
  90. ###################
  91.  
  92. # use fastcgi for all php files
  93. location ~* \.php$
  94. {
  95.  
  96. try_files $uri /test1/index.php;
  97. fastcgi_pass 127.0.0.1:9000;
  98. fastcgi_index index.php;
  99. fastcgi_split_path_info ^(.+\.php)(.*)$;
  100. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  101. include fastcgi_params;
  102. }
  103.  
  104.  
  105. # deny access to apache .htaccess files
  106. location ~ /\.ht
  107. {
  108. deny all;
  109. }
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement