Hello all,
I have the following problem with Nextcloud when used behind SWAG. No matter what I tried I always get 400 Bad Request Request Header Or Cookie Too Large
.
Here is my config:
Nextcloud
:
services:
nextcloud:
image: docker.io/linuxserver/nextcloud:31.0.2
container_name: nextcloud
networks:
- home
environment:
- PUID=1000
- PGID=100
- TZ=Etc/UTC
volumes:
- ./config:/config
- ./data:/data
ports:
- 5000:443
restart: unless-stopped
networks:
home:
name: "home"
external: true
SWAG nextcloud config:
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name nextcloud.*;
include /config/nginx/ssl.conf;
location / {
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
set $upstream_app nextcloud;
set $upstream_port 5000;
set $upstream_proto https;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
# Disable SSL certificate validation
proxy_ssl_verify off;
# 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;
}
}
config.php
:
<?php
$CONFIG = array (
'datadirectory' => '/data',
'instanceid' => 'instanceID',
'passwordsalt' => 'SALT',
'secret' => 'SECRET',
'trusted_proxies' =>
array (
0 => 'swag',
),
'trusted_domains' =>
array (
0 => '192.168.1.60:5000',
1 => 'nextcloud.MYDOMAIN.COM',
),
'dbtype' => 'sqlite3', // only temp
'version' => '31.0.2.1',
'overwritehost' => 'nextcloud.MYDOMAIN.COM',
'overwriteprotocol' => 'https',
'overwrite.cli.url' => 'https://nextcloud.MYDOMAIN.COM/',
'installed' => true,
'memcache.local' => '\\OC\\Memcache\\APCu',
'filelocking.enabled' => true,
'memcache.locking' => '\\OC\\Memcache\\APCu',
'upgrade.disable-web' => true,
);
I’ve tried different browsers and also cleared cookies. I’m pretty sure the problem has something to do with SWAG (nginx) not Nextcloud itself.