Skip to content

Commit c51e31e

Browse files
authored
Merge pull request #585 from linuxserver/nextcloud-headers
Nextcloud header adjustments
2 parents 6eab17b + f6d6c03 commit c51e31e

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

nextcloud.subdomain.conf.sample

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Version 2023/06/06
1+
## Version 2023/06/24
22
# make sure that your nextcloud container is named nextcloud
33
# make sure that your dns has a cname set for nextcloud
44
# assuming this container is called "swag", edit your nextcloud container's config
@@ -32,8 +32,14 @@ server {
3232
set $upstream_proto https;
3333
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
3434

35-
# Uncomment X-Frame-Options directive in ssl.conf to pass security checks.
35+
# Hide proxy response headers from Nextcloud that conflict with ssl.conf
36+
# Uncomment the Optional additional headers in SWAG's ssl.conf to pass Nextcloud's security scan
37+
proxy_hide_header Referrer-Policy;
38+
proxy_hide_header X-Content-Type-Options;
3639
proxy_hide_header X-Frame-Options;
40+
proxy_hide_header X-XSS-Protection;
41+
42+
# Disable proxy buffering
3743
proxy_buffering off;
3844
}
3945
}

nextcloud.subfolder.conf.sample

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Version 2023/06/06
1+
## Version 2023/06/24
22
# make sure that your nextcloud container is named nextcloud
33
# make sure that nextcloud is set to work with the base url /nextcloud/
44
# Assuming this container is called "swag", edit your nextcloud container's config
@@ -34,10 +34,18 @@ location ^~ /nextcloud/ {
3434
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
3535

3636
rewrite /nextcloud(.*) $1 break;
37-
# Uncomment X-Frame-Options directive in ssl.conf to pass security checks.
38-
proxy_hide_header X-Frame-Options;
39-
proxy_buffering off;
37+
4038
proxy_set_header Range $http_range;
4139
proxy_set_header If-Range $http_if_range;
4240
proxy_ssl_session_reuse off;
41+
42+
# Hide proxy response headers from Nextcloud that conflict with ssl.conf
43+
# Uncomment the Optional additional headers in SWAG's ssl.conf to pass Nextcloud's security scan
44+
proxy_hide_header Referrer-Policy;
45+
proxy_hide_header X-Content-Type-Options;
46+
proxy_hide_header X-Frame-Options;
47+
proxy_hide_header X-XSS-Protection;
48+
49+
# Disable proxy buffering
50+
proxy_buffering off;
4351
}

0 commit comments

Comments
 (0)