Skip to content

Commit 5ac20a6

Browse files
janepiebackportbot[bot]
authored andcommitted
Add HSTS header to static assets
Signed-off-by: janepie <49834966+janepie@users.noreply.github.com>
1 parent f850cf9 commit 5ac20a6

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

admin_manual/installation/nginx-root.conf.sample

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,15 @@ server {
192192
# Serve static files
193193
location ~ \.(?:css|js|mjs|svg|gif|ico|jpg|png|webp|wasm|tflite|map|ogg|flac|mp4|webm)$ {
194194
try_files $uri /index.php$request_uri;
195+
196+
# HSTS settings
197+
# WARNING: Only add the preload option once you read about
198+
# the consequences in https://hstspreload.org/. This option
199+
# will add the domain to a hardcoded list that is shipped
200+
# in all major browsers and getting removed from this list
201+
# could take several months.
202+
#add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
203+
195204
# HTTP response headers borrowed from Nextcloud `.htaccess`
196205
add_header Cache-Control "public, max-age=15778463$asset_immutable";
197206
add_header Referrer-Policy "no-referrer" always;

0 commit comments

Comments
 (0)