diff --git a/core/nginx/conf/nginx.conf b/core/nginx/conf/nginx.conf index 5a86c34a..4c31674c 100644 --- a/core/nginx/conf/nginx.conf +++ b/core/nginx/conf/nginx.conf @@ -57,11 +57,6 @@ http { proxy_pass http://127.0.0.1:8008; } {% endif %} - # robots.txt - location = /robots.txt { - add_header Content-Type text/plain; - return 200 "User-agent: *\nDisallow: /\n"; - } # redirect to https location / { return 301 https://$host$request_uri; @@ -111,8 +106,6 @@ http { # Remove headers to prevent duplication and information disclosure proxy_hide_header X-XSS-Protection; proxy_hide_header X-Powered-By; - - expires $expires; add_header X-Frame-Options 'SAMEORIGIN'; add_header X-Content-Type-Options 'nosniff'; @@ -132,18 +125,12 @@ http { return 403; } {% else %} - - # robots.txt - location = /robots.txt { - add_header Content-Type text/plain; - return 200 "User-agent: *\nDisallow: /\n"; - } - include /overrides/*.conf; # Actual logic {% if WEB_WEBMAIL != '/' and WEBROOT_REDIRECT != 'none' %} location / { + expires $expires; {% if WEBROOT_REDIRECT %} try_files $uri {{ WEBROOT_REDIRECT }}; {% else %} @@ -198,6 +185,7 @@ http { include /etc/nginx/proxy.conf; proxy_set_header X-Forwarded-Prefix {{ WEB_ADMIN }}; proxy_pass http://$admin; + expires $expires; } location {{ WEB_ADMIN }}/antispam { diff --git a/core/nginx/static/robots.txt b/core/nginx/static/robots.txt new file mode 100644 index 00000000..1f53798b --- /dev/null +++ b/core/nginx/static/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: /