Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- server_name localhost;
- #charset koi8-r;
- #access_log /var/log/nginx/log/host.access.log main;
- location / {
- root /usr/share/nginx/html;
- index index.html index.htm;
- }
- #error_page 404 /404.html;
- # redirect server error pages to the static page /50x.html
- #
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root /usr/share/nginx/html;
- }
- }
- server {
- ## Your website name goes here.
- server_name mysite.com test.mysite.com;
- ## Your only path reference.
- root /var/www/;
- listen 80;
- #listen 127.0.0.1;
- client_max_body_size 20M;
- ## This should be in your http block and if it is, it's not needed here.
- index index.html index.htm index.php;
- include conf.d/drop;
- location / {
- # This is cool because no php is touched for static content
- try_files $uri $uri/ /index.php?q=$uri&$args;
- }
- location ~ \.php$ {
- fastcgi_buffers 8 256k;
- fastcgi_buffer_size 128k;
- #fastcgi_pass 127.0.0.1:9000;
- fastcgi_intercept_errors on;
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_pass unix:/dev/shm/php-fpm-www.sock;
- }
- location /phpmyadmin {
- root /usr/share/;
- index index.php index.html index.htm;
- location ~ ^/phpmyadmin/(.+\.php)$ {
- try_files $uri =404;
- root /usr/share/;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME /usr/share/$fastcgi_script_name;
- include /etc/nginx/fastcgi_params;
- }
- location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
- root /usr/share/;
- }
- }
- location /phpMyAdmin {
- rewrite ^/* /phpmyadmin last;
- }
- # BEGIN W3TC Page Cache cache
- location ~ /wp-content/w3tc/pgcache.*html$ {
- add_header Vary "Accept-Encoding, Cookie";
- }
- location ~ /wp-content/w3tc/pgcache.*gzip$ {
- gzip off;
- types {}
- default_type text/html;
- add_header Vary "Accept-Encoding, Cookie";
- add_header Content-Encoding gzip;
- }
- # END W3TC Page Cache cache
- # BEGIN W3TC Browser Cache
- gzip on;
- gzip_types text/css application/x-javascript text/x-component text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;
- location ~ \.(css|js|htc)$ {
- }
- location ~ \.(html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml)$ {
- }
- location ~ \.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$ {
- }
- # END W3TC Browser Cache
- # BEGIN W3TC Page Cache core
- rewrite ^(.*\/)?w3tc_rewrite_test$ $1?w3tc_rewrite_test=1 last;
- set $w3tc_rewrite 1;
- if ($request_method = POST) {
- set $w3tc_rewrite 0;
- }
- if ($query_string != "") {
- set $w3tc_rewrite 0;
- }
- if ($http_host !~ "connectingdirectors.com") {
- set $w3tc_rewrite 0;
- }
- set $w3tc_rewrite3 1;
- if ($request_uri ~* "(\/wp-admin\/|\/xmlrpc.php|\/wp-(app|cron|login|register|mail)\.php|\/feed\/|wp-.*\.php|index\.php)") {
- set $w3tc_rewrite3 0;
- }
- if ($request_uri ~* "(wp\-comments\-popup\.php|wp\-links\-opml\.php|wp\-locations\.php)") {
- set $w3tc_rewrite3 1;
- }
- if ($w3tc_rewrite3 != 1) {
- set $w3tc_rewrite 0;
- }
- if ($http_cookie ~* "(comment_author|wp\-postpass|wordpress_\[a\-f0\-9\]\+|wordpress_logged_in)") {
- set $w3tc_rewrite 0;
- }
- if ($http_user_agent ~* "(W3\ Total\ Cache/0\.9\.2\.4)") {
- set $w3tc_rewrite 0;
- }
- set $w3tc_ua "";
- set $w3tc_ref "";
- set $w3tc_ssl "";
- set $w3tc_enc "";
- if ($http_accept_encoding ~ gzip) {
- set $w3tc_enc _gzip;
- }
- set $w3tc_ext "";
- if (-f "$document_root/wp-content/w3tc/pgcache/$request_uri/_index$w3tc_ua$w3tc_ref$w3tc_ssl.html$w3tc_enc") {
- set $w3tc_ext .html;
- }
- if ($w3tc_ext = "") {
- set $w3tc_rewrite 0;
- }
- if ($w3tc_rewrite = 1) {
- rewrite .* "/wp-content/w3tc/pgcache/$request_uri/_index$w3tc_ua$w3tc_ref$w3tc_ssl$w3tc_ext$w3tc_enc" last;
- }
- # END W3TC Page Cache core
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement