|
@ -15,18 +15,6 @@ server { |
|
|
root /var/www/example.com/htdocs; |
|
|
root /var/www/example.com/htdocs; |
|
|
index index.php index.htm index.html; |
|
|
index index.php index.htm index.html; |
|
|
|
|
|
|
|
|
if (!-e $request_filename) { |
|
|
|
|
|
|
|
|
|
|
|
# Redirect wp-admin To wp-admin/ |
|
|
|
|
|
rewrite /wp-admin$ $scheme://$host$uri/ permanent; |
|
|
|
|
|
|
|
|
|
|
|
# Redirect wp-* Files/Folders |
|
|
|
|
|
rewrite ^(/[^/]+)?(/wp-.*) $2 last; |
|
|
|
|
|
|
|
|
|
|
|
# Redirect Other PHP Files |
|
|
|
|
|
rewrite ^(/[^/]+)?(/.*\.php) $2 last; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
set $cache_uri $request_uri; |
|
|
set $cache_uri $request_uri; |
|
|
|
|
|
|
|
|
# POST Requests And Urls With A Query String Should Always Go To PHP |
|
|
# POST Requests And Urls With A Query String Should Always Go To PHP |
|
@ -48,6 +36,18 @@ server { |
|
|
set $cache_uri 'null cache'; |
|
|
set $cache_uri 'null cache'; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!-e $request_filename) { |
|
|
|
|
|
|
|
|
|
|
|
# Redirect wp-admin To wp-admin/ |
|
|
|
|
|
rewrite /wp-admin$ $scheme://$host$uri/ permanent; |
|
|
|
|
|
|
|
|
|
|
|
# Redirect wp-* Files/Folders |
|
|
|
|
|
rewrite ^(/[^/]+)?(/wp-.*) $2 last; |
|
|
|
|
|
|
|
|
|
|
|
# Redirect Other PHP Files |
|
|
|
|
|
rewrite ^(/[^/]+)?(/.*\.php) $2 last; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
# 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/cache/page_enhanced/${host}${cache_uri}_index.html $uri $uri/ /index.php?$args; |
|
|
try_files /wp-content/cache/page_enhanced/${host}${cache_uri}_index.html $uri $uri/ /index.php?$args; |
|
|