fix content-type e rewrite ICS #301

Merged
paspo merged 2 commits from paspo/bglug.it:fix_ics into main 2024-10-21 21:24:02 +00:00
Showing only changes of commit e908821e2e - Show all commits

View File

@ -6,47 +6,33 @@ server {
sendfile off; sendfile off;
root /wwwroot; root /wwwroot;
index index.html; index index.html;
error_page 404 /it/404.html;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload";
add_header Content-Security-Policy "default-src 'self'; img-src https://*; child-src 'none';";
types { types {
text/calendar ics; text/calendar ics;
} }
location ~ .* {
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload";
add_header Content-Security-Policy "default-src 'self'; img-src https://*; child-src 'none';";
}
location ~ ^/feed { location ~ ^/feed {
rewrite ^/feed$ /it/index.xml last; rewrite ^/feed$ /it/index.xml last;
rewrite ^/feed/.*$ /it/index.xml last; rewrite ^/feed/.*$ /it/index.xml last;
} }
location ~ /events/elenco/ { location ~ ^/events/elenco/ {
default_type "text/calendar";
try_files $uri /it/index.ics;
}
location ~ \.ics$ {
default_type "text/calendar"; default_type "text/calendar";
rewrite ^/events/elenco/.*$ /it/index.ics last;
} }
location ~ ^/wp\-content/uploads/2008/02/Statuto\.pdf$ { location ~ ^/wp\-content/uploads/2008/02/Statuto\.pdf$ {
return 301 https://bglug.it/it/chi-siamo/Statuto.pdf; return 301 https://bglug.it/it/chi-siamo/Statuto.pdf;
} }
location ~ ^/it/.* {
error_page 404 /it/404.html;
}
location ~ ^/en/.* { location ~ ^/en/.* {
error_page 404 /en/404.html; error_page 404 /en/404.html;
} }
location ~ .* {
error_page 404 /it/404.html;
}
} }
gzip on; gzip on;