diff --git a/etc/nginx/common/locations.conf b/etc/nginx/common/locations.conf index 63fc7e66..0b184de8 100644 --- a/etc/nginx/common/locations.conf +++ b/etc/nginx/common/locations.conf @@ -63,7 +63,8 @@ location ~ /readme\.(txt|html)$ { } # Disallow PHP In Upload Folder -location /wp-content/uploads/{ +location /wp-content/uploads/ { + location ~ \.php$ { #Prevent Direct Access Of PHP Files From Web Browsers deny all; diff --git a/usr/share/easyengine/nginx/wpsingle/basic.conf b/usr/share/easyengine/nginx/wpsingle/basic.conf index 9b09ad4e..94c28631 100644 --- a/usr/share/easyengine/nginx/wpsingle/basic.conf +++ b/usr/share/easyengine/nginx/wpsingle/basic.conf @@ -9,7 +9,7 @@ server { index index.php index.htm index.html; location / { - try_files $uri $uri/ /index.php?$args; + try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { diff --git a/usr/share/easyengine/nginx/wpsingle/w3tc.conf b/usr/share/easyengine/nginx/wpsingle/w3tc.conf index 1e56fbd7..055630de 100644 --- a/usr/share/easyengine/nginx/wpsingle/w3tc.conf +++ b/usr/share/easyengine/nginx/wpsingle/w3tc.conf @@ -14,7 +14,7 @@ server { if ($request_method = POST) { set $cache_uri 'null cache'; } - + if ($query_string != "") { set $cache_uri 'null cache'; } @@ -22,7 +22,7 @@ server { # Don't Cache Uris Containing The Following Segments if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") { set $cache_uri 'null cache'; - } + } # Don't Use The Cache For Logged In Users Or Recent Commenters if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") { @@ -31,11 +31,11 @@ server { # Use Cached Or Actual File If They Exists, Otherwise Pass Request To WordPress location / { - try_files /wp-content/cache/page_enhanced/$http_host/_index.html $uri $uri/ /index.php?$args; - } + try_files /wp-content/cache/page_enhanced/${host}${cache_uri}_index.html $uri $uri/ /index.php?$args; + } location ~ .php$ { - try_files $uri /index.php; + try_files $uri /index.php; include fastcgi_params; fastcgi_pass php; }