diff --git a/http/Provision/Config/Nginx/Inc/vhost_include.tpl.php b/http/Provision/Config/Nginx/Inc/vhost_include.tpl.php index 43e38dc0deb9b5144ea9e470444f287dc1af2dda..d3ad2b21a831d5e7f94ae7d6d6b8e54998f95cd2 100644 --- a/http/Provision/Config/Nginx/Inc/vhost_include.tpl.php +++ b/http/Provision/Config/Nginx/Inc/vhost_include.tpl.php @@ -480,6 +480,14 @@ location ~* ^/sites/.*/files/civicrm/(?:ConfigAndLog|upload|templates_c) { } +### +### Deny often flooded URI for performance reasons +### +location = /autodiscover/autodiscover.xml { + access_log off; + return 404; +} + ### ### Deny some not supported URI like cgi-bin on the Nginx level. ### @@ -957,10 +965,6 @@ location ~* ^/sites/.*/files/ { ### Make feeds compatible with boost caching and set correct mime type. ### location ~* \.xml$ { - location ~* ^/autodiscover/autodiscover\.xml { - access_log off; - return 400; - } if ( $request_method = POST ) { return 405; } diff --git a/http/Provision/Config/Nginx/subdir.tpl.php b/http/Provision/Config/Nginx/subdir.tpl.php index 27ed837182e49b0bad23794eb2f28ace704bc464..1cea000a510d1e50bbbc107ff2413070dbb156a3 100644 --- a/http/Provision/Config/Nginx/subdir.tpl.php +++ b/http/Provision/Config/Nginx/subdir.tpl.php @@ -460,6 +460,14 @@ location ^~ / { return 404; } + ### + ### Deny often flooded URI for performance reasons + ### + location = //autodiscover/autodiscover.xml { + access_log off; + return 404; + } + ### ### Responsive Images support. @@ -823,10 +831,6 @@ location ^~ / { ### Make feeds compatible with boost caching and set correct mime type. ### location ~* ^//(.*\.xml)$ { - location ~* ^//autodiscover/autodiscover\.xml { - access_log off; - return 400; - } if ( $request_method = POST ) { return 405; }