summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAAJ2019-03-02 00:54:51 (GMT)
committerAAJ2019-03-02 00:54:51 (GMT)
commit944ba23e7db839bdcee9a4dab88f35f9e909a160 (patch)
tree90505e7f28ef07d172f1c16205d37da7f2f4fc56
parent41e83683f0308685cd1bc40ee4b5ec339b58b963 (diff)
Nginx: Fix regex unexpectedly disabing caching and blocking crawlers
-rw-r--r--http/Provision/Config/Nginx/Inc/vhost_include.tpl.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/http/Provision/Config/Nginx/Inc/vhost_include.tpl.php b/http/Provision/Config/Nginx/Inc/vhost_include.tpl.php
index a45ab5d..9e7f947 100644
--- a/http/Provision/Config/Nginx/Inc/vhost_include.tpl.php
+++ b/http/Provision/Config/Nginx/Inc/vhost_include.tpl.php
@@ -1136,7 +1136,15 @@ location ~* \.xml$ {
###
### Deny bots on never cached uri.
###
-location ~* ^/(?:.*/)?(?:admin|user|cart|checkout|logout|comment/reply) {
+location ~* ^/(?:admin|user|cart|checkout|logout) {
+ if ( $is_bot ) {
+ return 403;
+ }
+ access_log off;
+ set $nocache_details "Skip";
+ try_files $uri @drupal;
+}
+location ~* ^/\w\w/(?:admin|user|cart|checkout|logout) {
if ( $is_bot ) {
return 403;
}
@@ -1148,7 +1156,7 @@ location ~* ^/(?:.*/)?(?:admin|user|cart|checkout|logout|comment/reply) {
###
### Protect from DoS attempts on never cached uri.
###
-location ~* ^/(?:.*/)?(?:node/[0-9]+/edit|node/add) {
+location ~* ^/(?:.*/)?(?:node/[0-9]+/edit|node/add|comment/reply) {
if ( $is_bot ) {
return 403;
}