nginx tweaks

This commit is contained in:
robert dennis
2026-10-06 20:11:59 -04:00
parent 7db75f2e4a
commit dd1f20fc0a
4 changed files with 29 additions and 8 deletions
+14 -4
View File
@@ -63,10 +63,9 @@ server {
}
# Extension files are third-party content on the panel's origin. The sandbox stops a
# file opened directly (an SVG, say) from running script as the panel; scripts the
# panel imports are unaffected. ^~ skips the regex locations above, so dotfiles are
# denied again here. add_header at this level drops the server-level headers, so
# they are repeated.
# file opened directly (an SVG, say) from running script as the panel. ^~ skips the
# regex locations above, so dotfiles are denied again here. add_header at this level
# drops the server-level headers, so they are repeated.
location ^~ /assets/extensions/ {
add_header Strict-Transport-Security "max-age=15768000; preload;";
add_header X-Content-Type-Options nosniff always;
@@ -78,6 +77,17 @@ server {
deny all;
}
# A sandbox policy would stop these from starting as workers, and a script never
# renders as a page, so it gets the server-level headers only.
location ~ \.m?js$ {
add_header Strict-Transport-Security "max-age=15768000; preload;";
add_header X-Content-Type-Options nosniff always;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header Content-Security-Policy "frame-ancestors 'self'";
try_files $uri =404;
}
try_files $uri =404;
}