nixos/nextcloud: add Strict-Transport-Security
This commit adds a Strict-Transport-Security header to
the nginx config file generated by the nextcloud module.
The Strict-Transport-Security header is recommended in
official guide for hardening Nextcloud installations:
https://docs.nextcloud.com/server/16/admin_manual/installation/harden_server.html
Further, if it is not set, we see a warning in the security scan results
in the Nextcloud admin panel:
```
The "Strict-Transport-Security" HTTP header is not set to at least "15552000" seconds. For enhanced security, it is recommended to enable HSTS as described in the security tips
```
commit4590a2380efb49da0a4fdb60890537ebc408b31e
authorDaniel KT <dan@koumbit.org>
dateWed 25 Sep 2019, 16:56 (7 years ago)
parent99b12cf
nixos/modules/services/web-apps/nextcloud.nix+1
@@ -531,6 +531,7 @@ in {
531531 add_header X-Download-Options noopen;
532532 add_header X-Permitted-Cross-Domain-Policies none;
533533 add_header Referrer-Policy no-referrer;
534+ add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
534535 error_page 403 /core/templates/403.php;
535536 error_page 404 /core/templates/404.php;
536537 client_max_body_size ${cfg.maxUploadSize};