Advertisement
ovizii

vhost

Jul 15th, 2013
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.80 KB | None | 0 0
  1. server {
  2. listen *:80;
  3. server_name foodandchatter.co.za www.foodandchatter.co.za;
  4. root /var/www/foodandchatter.co.za/web;
  5.  
  6. index index.html index.htm index.php index.cgi index.pl index.xhtml;
  7.  
  8. error_log /var/log/ispconfig/httpd/foodandchatter.co.za/error.log;
  9. access_log /var/log/ispconfig/httpd/foodandchatter.co.za/access.log combined buffer=32k;
  10.  
  11. ## Disable .htaccess and other hidden files
  12. location ~ /\. {
  13. deny all;
  14. access_log off;
  15. log_not_found off;
  16. }
  17.  
  18. location = /favicon.ico {
  19. log_not_found off;
  20. access_log off;
  21. }
  22.  
  23. location = /robots.txt {
  24. allow all;
  25. log_not_found off;
  26. access_log off;
  27. }
  28.  
  29. location /stats {
  30. index index.html index.php;
  31. auth_basic "Members Only";
  32. auth_basic_user_file /var/www/clients/client2/web8/web/stats/.htpasswd_stats;
  33. }
  34.  
  35. location ^~ /awstats-icon {
  36. alias /usr/share/awstats/icon;
  37. }
  38.  
  39. location ~ \.php$ {
  40. try_files /dc2c9cd0a963abe130f558ccca84e2e9.htm @php;
  41. }
  42.  
  43. location @php {
  44. try_files $uri =404;
  45. include /etc/nginx/fastcgi_params;
  46. fastcgi_pass unix:/var/lib/php5-fpm/web8.sock;
  47. fastcgi_index index.php;
  48. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  49. #fastcgi_param PATH_INFO $fastcgi_script_name;
  50. fastcgi_intercept_errors on;
  51. fastcgi_buffer_size 128k;
  52. fastcgi_buffers 256 16k;
  53. fastcgi_busy_buffers_size 256k;
  54. fastcgi_temp_file_write_size 256k;
  55. fastcgi_read_timeout 240;
  56. fastcgi_cache_bypass $skip_cache;
  57. fastcgi_no_cache $skip_cache;
  58. fastcgi_cache WORDPRESS;
  59. fastcgi_cache_valid 60m;
  60. }
  61. location /webmail {
  62. root /var/www/;
  63. index index.php index.html index.htm;
  64. location ~ ^/webmail/(.+\.php)$ {
  65. try_files $uri =404;
  66. root /var/www/;
  67. fastcgi_pass 127.0.0.1:9000;
  68. fastcgi_index index.php;
  69. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  70. include /etc/nginx/fastcgi_params;
  71. fastcgi_buffer_size 128k;
  72. fastcgi_buffers 256 4k;
  73. fastcgi_busy_buffers_size 256k;
  74. fastcgi_temp_file_write_size 256k;
  75. fastcgi_intercept_errors on;
  76. }
  77. location ~* ^/webmail/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
  78. root /var/www/;
  79. }
  80. }
  81.  
  82.  
  83. location / {
  84. try_files $uri $uri/ /index.php?$args;
  85. }
  86. location ~* \.(jpg|jpeg|png|gif|ico|pdf)$ {
  87. expires 7d;
  88. }
  89. location /phpmyadmin {
  90. root /usr/share/;
  91. index index.php index.html index.htm;
  92. location ~ ^/phpmyadmin/(.+\.php)$ {
  93. try_files $uri =404;
  94. root /usr/share/;
  95. fastcgi_pass 127.0.0.1:9000;
  96. fastcgi_param HTTPS $fastcgi_https; # <-- add this line
  97. fastcgi_index index.php;
  98. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  99. include /etc/nginx/fastcgi_params;
  100. fastcgi_buffer_size 128k;
  101. fastcgi_buffers 256 4k;
  102. fastcgi_busy_buffers_size 256k;
  103. fastcgi_temp_file_write_size 256k;
  104. fastcgi_intercept_errors on;
  105. }
  106. location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
  107. root /usr/share/;
  108. }
  109. }
  110. location /phpMyAdmin {
  111. rewrite ^/* /phpmyadmin last;
  112. }
  113. #activating fastcgi_cache
  114. set $skip_cache 0;
  115.  
  116. # POST requests and urls with a query string should always go to PHP
  117. if ($request_method = POST) { set $skip_cache 1; }
  118. if ($query_string != "") { set $skip_cache 1; }
  119.  
  120. #Skip cache for WooCommerce query string
  121. if ( $arg_add-to-cart != "" ) { set $skip_cache 1; }
  122.  
  123. #Skip cache when WooCommerce cart is not empty
  124. if ( $cookie_woocommerce_items_in_cart != "0" ) { set $skip_cache 1; }
  125.  
  126. # Don't use the cache for logged in users or recent commenters
  127. if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") { set $skip_cache 1; }
  128.  
  129. # Don't cache uris containing the following segments
  130. if ($request_uri ~* ("/wp-admin.*|/cart.*|/checkout.*|/account.*|/myaccount.*|/addond.*|/store.*|/shop.*|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-ocations.php|sitemap(_index)?.xml|a-z0-9_-]+-sitemap([0-9]+)?.xml)") { set $skip_cache 1; }
  131.  
  132. location ~ /purge(/.*) {
  133. fastcgi_cache_purge WORDPRESS "$scheme$request_method$host$1";
  134. }
  135.  
  136.  
  137. }
  138.  
  139. server {
  140. listen *:80;
  141.  
  142.  
  143. server_name foodandchaatter.co.za;
  144. rewrite ^ http://foodandchatter.co.za$request_uri? permanent;
  145. }
  146. server {
  147. listen *:80;
  148.  
  149.  
  150. server_name www.foodandchaatter.co.za;
  151. if ($http_host != "foodandchaatter.co.za") {
  152. rewrite ^ $scheme://foodandchaatter.co.za$request_uri? permanent;
  153. }
  154. rewrite ^ http://foodandchatter.co.za$request_uri? permanent;
  155. }
  156. server {
  157. listen *:80;
  158.  
  159.  
  160. server_name food-and-chaatter.co.za;
  161. rewrite ^ http://foodandchatter.co.za$request_uri? permanent;
  162. }
  163. server {
  164. listen *:80;
  165.  
  166.  
  167. server_name www.food-and-chaatter.co.za;
  168. if ($http_host != "food-and-chaatter.co.za") {
  169. rewrite ^ $scheme://food-and-chaatter.co.za$request_uri? permanent;
  170. }
  171. rewrite ^ http://foodandchatter.co.za$request_uri? permanent;
  172. }
  173. server {
  174. listen *:80;
  175.  
  176.  
  177. server_name foodchaatter.co.za;
  178. rewrite ^ http://foodandchatter.co.za$request_uri? permanent;
  179. }
  180. server {
  181. listen *:80;
  182.  
  183.  
  184. server_name www.foodchaatter.co.za;
  185. if ($http_host != "foodchaatter.co.za") {
  186. rewrite ^ $scheme://foodchaatter.co.za$request_uri? permanent;
  187. }
  188. rewrite ^ http://foodandchatter.co.za$request_uri? permanent;
  189. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement