mirror of
https://github.com/linuxserver/reverse-proxy-confs.git
synced 2025-03-12 05:25:24 -07:00
59 lines
2.1 KiB
Plaintext
59 lines
2.1 KiB
Plaintext
## Version 2024/03/26
|
|
# make sure that your nextcloud container is named nextcloud
|
|
# make sure that your dns has a cname set for nextcloud
|
|
# assuming this container is called "swag", edit your nextcloud container's config
|
|
# located at /config/www/nextcloud/config/config.php and add the following lines before the ");":
|
|
# 'trusted_proxies' => ['swag'],
|
|
# 'overwrite.cli.url' => 'https://nextcloud.example.com/',
|
|
# 'overwritehost' => 'nextcloud.example.com',
|
|
# 'overwriteprotocol' => 'https',
|
|
#
|
|
# Also don't forget to add your domain name to the trusted domains array. It should look somewhat like this:
|
|
# array (
|
|
# 0 => '192.168.0.1:444', # This line may look different on your setup, don't modify it.
|
|
# 1 => 'nextcloud.example.com',
|
|
# ),
|
|
#
|
|
# The /push/ location block works with the optional notify-push mod:
|
|
# https://github.com/linuxserver/docker-mods/tree/nextcloud-notify-push
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
|
|
server_name nextcloud.*;
|
|
|
|
include /config/nginx/ssl.conf;
|
|
|
|
client_max_body_size 0;
|
|
|
|
location / {
|
|
include /config/nginx/proxy.conf;
|
|
include /config/nginx/resolver.conf;
|
|
set $upstream_app nextcloud;
|
|
set $upstream_port 443;
|
|
set $upstream_proto https;
|
|
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
|
|
|
|
# Hide proxy response headers from Nextcloud that conflict with ssl.conf
|
|
# Uncomment the Optional additional headers in SWAG's ssl.conf to pass Nextcloud's security scan
|
|
proxy_hide_header Referrer-Policy;
|
|
proxy_hide_header X-Content-Type-Options;
|
|
proxy_hide_header X-Frame-Options;
|
|
proxy_hide_header X-XSS-Protection;
|
|
|
|
# Disable proxy buffering
|
|
proxy_buffering off;
|
|
}
|
|
|
|
location ^~ /push/ {
|
|
include /config/nginx/proxy.conf;
|
|
include /config/nginx/resolver.conf;
|
|
set $upstream_app nextcloud;
|
|
# The url below is for the notify-push service running inside the NC container
|
|
# The address should be the NC container's address, but the proto and port are the custom service's
|
|
proxy_pass http://$upstream_app:7867/;
|
|
}
|
|
|
|
}
|