Add HSTS header and discovery config 2

This commit is contained in:
Ruben Hensen
2025-02-04 14:03:59 +01:00
parent baefe1258d
commit 8b878c00be
+24 -24
View File
@@ -54,30 +54,30 @@ spec:
cert-manager.io/cluster-issuer: prod-cluster-issuer cert-manager.io/cluster-issuer: prod-cluster-issuer
# # Keep this in sync with the README.md: # # Keep this in sync with the README.md:
nginx.ingress.kubernetes.io/server-snippet: |- nginx.ingress.kubernetes.io/server-snippet: |-
server_tokens off; server_tokens off;
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;"; add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
proxy_hide_header X-Powered-By; proxy_hide_header X-Powered-By;
rewrite ^/.well-known/webfinger /index.php/.well-known/webfinger last; rewrite ^/.well-known/webfinger /index.php/.well-known/webfinger last;
rewrite ^/.well-known/nodeinfo /index.php/.well-known/nodeinfo last; rewrite ^/.well-known/nodeinfo /index.php/.well-known/nodeinfo last;
rewrite ^/.well-known/host-meta /public.php?service=host-meta last; rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json; rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json;
location = /.well-known/carddav { location = /.well-known/carddav {
return 301 $scheme://$host/remote.php/dav; return 301 $scheme://$host/remote.php/dav;
} }
location = /.well-known/caldav { location = /.well-known/caldav {
return 301 $scheme://$host/remote.php/dav; return 301 $scheme://$host/remote.php/dav;
} }
location = /robots.txt { location = /robots.txt {
allow all; allow all;
log_not_found off; log_not_found off;
access_log off; access_log off;
} }
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ { location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
deny all; deny all;
} }
location ~ ^/(?:autotest|occ|issue|indie|db_|console) { location ~ ^/(?:autotest|occ|issue|indie|db_|console) {
deny all; deny all;
} }
tls: tls:
- secretName: nextcloud-tls - secretName: nextcloud-tls
hosts: hosts: