1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-12 10:45:38 +02:00

set expire headers only for mailu content

also moved robots.txt from config to static folder.
This commit is contained in:
Alexander Graf 2021-09-06 13:45:48 +02:00
parent 698ee4e521
commit b445d9ddd1
2 changed files with 4 additions and 14 deletions

View File

@ -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 {

View File

@ -0,0 +1,2 @@
User-agent: *
Disallow: /