Advertisement
Guest User

Untitled

a guest
Mar 24th, 2014
725
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.41 KB | None | 0 0
  1. # WPSINGLE W3 TOTAL CACHE NGINX CONFIGURATION
  2. server {
  3.  
  4. server_name arcwaveusa.com www.arcwaveusa.com;
  5.  
  6. access_log /var/log/nginx/arcwaveusa.com.access.log rt_cache;
  7. error_log /var/log/nginx/arcwaveusa.com.error.log;
  8.  
  9. root /var/www/arcwaveusa.com/htdocs;
  10. index index.php index.htm index.html;
  11.  
  12. set $cache_uri $request_uri;
  13.  
  14. # POST Requests And Urls With A Query String Should Always Go To PHP
  15. if ($request_method = POST) {
  16. set $cache_uri 'null cache';
  17. }
  18.  
  19. if ($query_string != "") {
  20. set $cache_uri 'null cache';
  21. }
  22.  
  23. # Don't Use The Cache For Logged In Users Or Recent Commenters
  24. if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") {
  25. set $cache_uri 'null cache';
  26. }
  27.  
  28. # Use Cached Or Actual File If They Exists, Otherwise Pass Request To WordPress
  29. location / {
  30. try_files /wp-content/cache/page_enhanced/${host}${cache_uri}_index.html $uri $uri/ /index.php?$args;
  31. }
  32.  
  33. location ~ ^/wp-content/cache/minify/(.+\.(css|js))$ {
  34. try_files $uri /wp-content/plugins/w3-total-cache/pub/minify.php?file=$1;
  35. }
  36.  
  37. location ~ /signup/ {
  38. return 301 https://$server_name$request_uri;
  39. }
  40.  
  41. location ~ \.php$ {
  42. try_files $uri =404;
  43. include fastcgi_params;
  44. fastcgi_pass php;
  45. }
  46.  
  47. include common/wpcommon.conf;
  48. include common/locations.conf;
  49.  
  50. }
  51. server {
  52. listen 443;
  53. server_name arcwaveusa.com;
  54.  
  55. #wordpress install root
  56. root /var/www/arcwaveusa.com/htdocs;
  57. index index.php index.htm index.html;
  58.  
  59. ssl on;
  60. ssl_certificate /etc/nginx/ssl/ssl-bundle.crt;
  61. ssl_certificate_key /etc/nginx/ssl/server.key;
  62. ssl_ciphers ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM;
  63. ssl_protocols SSLv3 TLSv1;
  64.  
  65.  
  66.  
  67. access_log /var/log/nginx/arcwaveusa.com.access.log rt_cache;
  68. error_log /var/log/nginx/arcwaveusa.com.error.log;
  69.  
  70. set $cache_uri $request_uri;
  71.  
  72. # POST Requests And Urls With A Query String Should Always Go To PHP
  73. if ($request_method = POST) {
  74. set $cache_uri 'null cache';
  75. }
  76.  
  77. if ($query_string != "") {
  78. set $cache_uri 'null cache';
  79. }
  80.  
  81. # Don't Use The Cache For Logged In Users Or Recent Commenters
  82. if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") {
  83. set $cache_uri 'null cache';
  84. }
  85.  
  86. # Use Cached Or Actual File If They Exists, Otherwise Pass Request To WordPress
  87. location / {
  88. try_files /wp-content/cache/page_enhanced/${host}${cache_uri}_index.html $uri $uri/ /index.php?$args;
  89. }
  90.  
  91. location ~ ^/wp-content/cache/minify/(.+\.(css|js))$ {
  92. try_files $uri /wp-content/plugins/w3-total-cache/pub/minify.php?file=$1;
  93. }
  94.  
  95. location ~ /signup/ {
  96. return 301 https://$server_name$request_uri;
  97. }
  98.  
  99. location ~ \.php$ {
  100. try_files $uri =404;
  101. include fastcgi_params;
  102. fastcgi_pass php;
  103. }
  104.  
  105. include common/wpcommon.conf;
  106. include common/locations.conf;
  107.  
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement