Advertisement
Guest User

Untitled

a guest
Mar 26th, 2012
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.29 KB | None | 0 0
  1. server {
  2. listen 8069;
  3. server_name www.dominio.com;
  4.  
  5. root /var/www/www.dominio.com/web;
  6.  
  7. index index.php index.html;
  8.  
  9. error_log /var/log/ispconfig/httpd/www.dominio.com/error.log;
  10. access_log /var/log/ispconfig/httpd/www.dominio.com/access.log combined;
  11.  
  12.  
  13. if ($http_host != "www.dominio.com") {
  14. rewrite ^ http://www.dominio.com$request_uri permanent;
  15. }
  16.  
  17. location = /favicon.ico {
  18. log_not_found off;
  19. access_log off;
  20. }
  21.  
  22. location = /robots.txt {
  23. allow all;
  24. log_not_found off;
  25. access_log off;
  26. }
  27.  
  28.  
  29. #----------------- vBulletin - VBSEO ---------------------
  30.  
  31. location /forum/ {
  32.  
  33. rewrite ^/forum/((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ /forum/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 last;
  34. try_files $uri $uri/ /forum/vbseo.php?$args;
  35. }
  36.  
  37. location ~ /forum/(.*\.php)$ {
  38.  
  39. rewrite ^/forum/(.*)$ /forum/vbseo.php last;
  40. }
  41.  
  42. location /forum/vbseo/(includes|resources/html|resources/xml)/ {
  43. allow 127.0.0.1;
  44. deny all;
  45. }
  46.  
  47.  
  48. # --------------- WORDPRESS -----------------
  49.  
  50.  
  51.  
  52. location ~ /\. {
  53. deny all;
  54. access_log off;
  55. log_not_found off;
  56. }
  57.  
  58. location / {
  59. try_files $uri $uri/ /index.php?$args;
  60. gzip on;
  61. gzip_http_version 1.0;
  62. gzip_vary on;
  63. gzip_comp_level 3;
  64. gzip_proxied any;
  65. gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
  66. gzip_buffers 16 8k;
  67. }
  68.  
  69. # Add trailing slash to */wp-admin requests.
  70. rewrite /wp-admin$ $scheme://$host$uri/ permanent;
  71.  
  72. location ~* \.(jpg|jpeg|png|gif|css|js|ico)$ {
  73. expires max;
  74. log_not_found off;
  75. }
  76.  
  77. location ~ \.php$ {
  78. include /etc/nginx/fastcgi_params;
  79. fastcgi_pass 127.0.0.1:9000;
  80. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  81. }
  82.  
  83. # if the requested file exists, return it immediately
  84. if (-f $request_filename) {
  85. break;
  86. }
  87.  
  88.  
  89. # --------------- W3 TOTAL CACHE -----------------
  90.  
  91.  
  92. ## W3 Total CACHE BEGIN
  93. set $totalcache_file '';
  94. set $totalcache_uri $request_uri;
  95.  
  96. if ($request_method = POST) {
  97. set $totalcache_uri '';
  98. }
  99.  
  100. # Using pretty permalinks, so bypass the cache for any query string
  101. if ($query_string) {
  102. set $totalcache_uri '';
  103. }
  104.  
  105. if ($http_cookie ~* "comment_author_|wordpress|wp-postpass_" ) {
  106. set $totalcache_uri '';
  107. }
  108.  
  109. # if we haven't bypassed the cache, specify our totalcache file
  110. if ($totalcache_uri ~ ^(.+)$) {
  111. set $totalcache_file /wp-content/w3tc-$http_host/pgcache/$1/_default_.html;
  112. }
  113.  
  114. # only rewrite to the totalcache file if it actually exists
  115. if (-f $document_root$totalcache_file) {
  116. rewrite ^(.*)$ $totalcache_file break;
  117. }
  118.  
  119. ##W3 Total CACHE END
  120.  
  121. # all other requests go to WordPress
  122. if (!-e $request_filename) {
  123. rewrite . /index.php last;
  124. }
  125. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement