-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
67d4fe0
commit bb4f001
Showing
5 changed files
with
332 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# WPSUBDOMAIN BASIC NGINX CONFIGURATION | ||
server { | ||
|
||
# Uncomment The Following Line For Domain Mapping | ||
# listen 80 default_server; | ||
|
||
server_name example.com *.example.com; | ||
|
||
# Uncomment The Following Line For Domain Mapping | ||
#server_name_in_redirect off; | ||
|
||
access_log /var/log/nginx/example.com.access.log; | ||
error_log /var/log/nginx/example.com.error.log; | ||
|
||
root /var/www/example.com/htdocs; | ||
index index.php index.htm index.html; | ||
|
||
location / { | ||
try_files $uri $uri/ /index.php?$args; | ||
} | ||
|
||
location ~ \.php$ { | ||
try_files $uri /index.php; | ||
include fastcgi_params; | ||
fastcgi_pass php; | ||
} | ||
|
||
include /etc/nginx/common/locations.conf; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# WPSUBDOMAIN W3 TOTAL CACHE NGINX CONFIGURATION | ||
server { | ||
|
||
# Uncomment The Following Line For Domain Mapping | ||
# listen 80 default_server; | ||
|
||
server_name example.com *.example.com; | ||
|
||
# Uncomment The Following Line For Domain Mapping | ||
#server_name_in_redirect off; | ||
|
||
access_log /var/log/nginx/example.com.access.log; | ||
error_log /var/log/nginx/example.com.error.log; | ||
|
||
root /var/www/example.com/htdocs; | ||
index index.php index.htm index.html; | ||
|
||
set $cache_uri $request_uri; | ||
|
||
# POST Requests And Urls With A Query String Should Always Go To PHP | ||
if ($request_method = POST) { | ||
set $cache_uri 'null cache'; | ||
} | ||
|
||
if ($query_string != "") { | ||
set $cache_uri 'null cache'; | ||
} | ||
|
||
# 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") { | ||
set $cache_uri 'null cache'; | ||
} | ||
|
||
# Use Cached Or Actual File If They Exists, Otherwise Pass Request To WordPress | ||
location / { | ||
try_files /wp-content/cache/page_enhanced/${host}${cache_uri}_index.html $uri $uri/ /index.php?$args; | ||
} | ||
|
||
location ~ .php$ { | ||
try_files $uri /index.php; | ||
include fastcgi_params; | ||
fastcgi_pass php; | ||
} | ||
|
||
include /etc/nginx/common/locations.conf; | ||
|
||
} |
Oops, something went wrong.