Skip to content

Commit 79d6ca8

Browse files
authored
Merge pull request #15470 from nextcloud/fix/hsts-static-assets
Add HSTS header to static assets
2 parents 9327f9f + 1b73b90 commit 79d6ca8

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
@@ -225,6 +225,15 @@ server {
225225
# Serve static files
226226
location ~ \.(?:css|js|mjs|svg|gif|ico|jpg|png|webp|wasm|tflite|map|ogg|flac|mp4|webm)$ {
227227
try_files $uri /index.php$request_uri;
228+
229+
# HSTS settings
230+
# WARNING: Only add the preload option once you read about
231+
# the consequences in https://hstspreload.org/. This option
232+
# will add the domain to a hardcoded list that is shipped
233+
# in all major browsers and getting removed from this list
234+
# could take several months.
235+
#add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
236+
228237
# HTTP response headers borrowed from Nextcloud `.htaccess`
229238
add_header Cache-Control "public, max-age=15778463$asset_immutable";
230239
add_header Referrer-Policy "no-referrer" always;

0 commit comments

Comments
 (0)