Created
February 26, 2017 11:03
-
-
Save NoobTW/dc792db77eaf749751d24721ec8bdad1 to your computer and use it in GitHub Desktop.
Nginx WordPress Configuration
This file contains hidden or 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
| set $cache_uri $request_uri; | |
| if ($request_method = POST) { | |
| set $cache_uri 'null cache'; | |
| } | |
| 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.$ | |
| set $cache_uri 'null cache'; | |
| } | |
| if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") { | |
| set $cache_uri 'null cache'; | |
| } | |
| location = /favicon.ico { log_not_found off; access_log off; } | |
| location = /robots.txt { log_not_found off; access_log off; } | |
| location / { | |
| index index.htm index.html index.php; | |
| try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?$query_string; | |
| } | |
| location ~ /(\.|wp-config.php|readme.html|license.txt) { | |
| deny all; | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment