|
@ -1,4 +1,5 @@ |
|
|
server { |
|
|
server { |
|
|
|
|
|
|
|
|
server_name example.com www.example.com; |
|
|
server_name example.com www.example.com; |
|
|
|
|
|
|
|
|
access_log /var/log/nginx/example.com.access.log; |
|
|
access_log /var/log/nginx/example.com.access.log; |
|
@ -13,6 +14,7 @@ server { |
|
|
if ($request_method = POST) { |
|
|
if ($request_method = POST) { |
|
|
set $cache_uri 'null cache'; |
|
|
set $cache_uri 'null cache'; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if ($query_string != "") { |
|
|
if ($query_string != "") { |
|
|
set $cache_uri 'null cache'; |
|
|
set $cache_uri 'null cache'; |
|
|
} |
|
|
} |
|
@ -29,22 +31,15 @@ server { |
|
|
|
|
|
|
|
|
# Use cached or actual file if they exists, otherwise pass request to WordPress |
|
|
# Use cached or actual file if they exists, otherwise pass request to WordPress |
|
|
location / { |
|
|
location / { |
|
|
#try_files /wp-content/w3tc/pgcache/$cache_uri/_index.html $uri $uri/ /index.php?$args; |
|
|
try_files /wp-content/cache/page_enhanced/$http_host/_index.html $uri $uri/ /index.php?$args; |
|
|
try_files /wp-content/cache/page_enhanced/$http_host/$cache_uri/_index.html $uri $uri/ /index.php?$args; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
location = /favicon.ico { log_not_found off; access_log off; } |
|
|
|
|
|
location = /robots.txt { log_not_found off; access_log off; } |
|
|
|
|
|
|
|
|
|
|
|
location ~ .php$ { |
|
|
location ~ .php$ { |
|
|
try_files $uri /index.php; |
|
|
try_files $uri /index.php; |
|
|
include fastcgi_params; |
|
|
include fastcgi_params; |
|
|
#fastcgi_pass 127.0.0.1:9000; |
|
|
fastcgi_pass php; |
|
|
fastcgi_pass unix:/var/run/php5-fpm.sock; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
# Cache static files for as long as possible |
|
|
include /etc/nginx/common/locations.conf; |
|
|
location ~* .(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ { |
|
|
|
|
|
expires max; log_not_found off; access_log off; |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|