Proxy Reverse nginx to Nextcloud - upstream too big

Hi guys. So I’ve got nginx and Nextcloud running from linuxserver.io docker images on my x32 arm system. Somehow im running into a weird issue with my nginx proxy setup. Following its logs after gettin 502 errors i noticed: upstream files are too big. A quick web search showed increasing buffer sizes. I also tried increasing the times. Which didnt solve the problem for me. Ill post the proxy.conf input. Would be great to hear what else might solve this?

proxy_buffer_size          128k;
proxy_buffers              4 256k;
proxy_busy_buffers_size    256k;
proxy_connect_timeout 240;
proxy_headers_hash_bucket_size 128;
proxy_headers_hash_max_size 1024;
proxy_http_version 1.1;
proxy_read_timeout 240;
proxy_redirect  http://  $scheme://;
proxy_send_timeout 240;

Hmm anything I can add or can you recommend some place else to ask? No comments yet…

You need to provide at least enough info for someone else to reproduce the issue.

All I’m seeing is a vague issue mention (502 errors) and some conclusions based on google searches that are not defined, therefore can’t be confirmed.

You also mention an nginx proxy but no info on how exactly you’re reverse proxying.

Okay thanks for your info.

Here is the error i am getting in webbrowser:
502 Bad Gateway
nginx/1.18.0

Within logs:
2021/03/03 23:13:26 [error] 1436#1436: *5129 upstream sent too big header while reading response header from upstream, client: 172.19.0.2, server: server, request: “GET /settings/admin/overview HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “server”
2021/03/03 23:13:33 [error] 1436#1436: *5131 FastCGI sent in stderr: “PHP message: {“reqId”:“9FlxuoxDaM71yRbJxjzd”,“level”:0,“time”:“2021-03-03T22:13:33+00:00”,“remoteAddr”:“IP”,“user”:“User”,“app”:“contacts”,“method”:“GET”,“url”:”/settings/admin/overview",“message”:"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.",“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0”,“version”:“21.0.0.18”}PHP message: {“reqId”:“9FlxuoxDaM71yRbJxjzd”,“level”:0,“time”:“2021-03-03T22:13:33+00:00”,“remoteAddr”:“IP”,“user”:“User”,“app”:“files_sharing”,“method”:“GET”,“url”:"/settings/admin/overview",“message”:"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.",“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0”,“version”:“21.0.0.18”}PHP message: {“reqId”:“9FlxuoxDaM71yRbJxjzd”,“level”:0,“time”:“2021-03-03T22:13:33+00:00”,“remoteAddr”:“IP”,“user”:“User”,“app”:“scss_cacher”,“method”:“GET”,“url”:"/settings/admin/overview",“message”:“SCSSCacher::process ordinary check follows”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0”,“version”:“21.0.0.18”}PHP message: {“reqId”:“9FlxuoxDaM71yRbJxjzd”,“level”:0,“time”:“2021-03-03T22:13:33+00:00”,“remoteAddr”:“IP”,“user”:“User”,“app”:“scss_cacher”,“method”:“GET”,“url”:"/settings/admin/overview",“message”:“SCSSCacher::process ordinary check follows”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0”,“version”:“21.0.0.18”}PHP message: {“reqId”:“9FlxuoxDaM71yRbJxjzd”,“level”:0,“time”:“2021-03-03T22:13:33+00:00”,“remoteAddr”:“IP”,“user”:“User”,“app”:“scss_cacher”,“method”:“GET”,“url”:"/settings/admin/overview",“message”:“SCSSCacher::process ordinary check follows”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0”,“version”:"21.0
2021/03/03 23:13:33 [error] 1436#1436: *5131 upstream sent too big header while reading response header from upstream, client: 172.19.0.2, server: server, request: “GET /settings/admin/overview HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “server”

What is weird is that the error only appears to be on when accessing specifig links like admin overview and apps. When accessing files the error does not appear.

I use linuxserver.io docker images for nextcloud and nginx. nextclouds setup is not adapted. I use swag as proxy with the following config:
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name server;
return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name server;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    location / {
        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
                proxy_pass http://IP;  ##which is set up to be a local ip within nginx-proxy network
  }
}

Both ssl.conf and proxy.conf are default. Output of proxy.conf:
# Timeout if the real server is dead
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;

# Proxy Connection Settings
proxy_buffer_size          128k;
proxy_buffers              4 256k;
proxy_busy_buffers_size    256k;
proxy_connect_timeout 240;
proxy_headers_hash_bucket_size 128;
proxy_headers_hash_max_size 1024;
proxy_http_version 1.1;
proxy_read_timeout 240;
proxy_redirect  http://  $scheme://;
proxy_send_timeout 240;

# Proxy Cache and Cookie Settings
proxy_cache_bypass $cookie_session;
#proxy_cookie_path / "/; Secure"; # enable at your own risk, may break certain apps
proxy_no_cache $cookie_session;

# Proxy Header Settings
proxy_set_header Connection $connection_upgrade;
proxy_set_header Early-Data $ssl_early_data;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Real-IP $remote_addr;

Docker swag:
version: “2”
services:
swag:
image: linuxserver/swag:arm32v7-latest
container_name: swag
dns: 8.8.8.8
cap_add:
- NET_ADMIN
networks:
nginx-proxy:
# ipv4_address: ‘IP’
environment:
- blurred
volumes:
- ./config:/config
ports:
- 443:443
restart: unless-stopped
logging:
driver: “json-file”
options:
max-file: “5”
max-size: “10m”

networks:
    nginx-proxy:
      external:
        name: nginx-proxy

Docker nextcloud:

version: “2”
services:
nextcloud:
image: linuxserver/nextcloud:arm32v7-latest
container_name: nextcloud
environment:
- PUID=0001
- PGID=000
- TZ=Europe/London
- MYSQL_PASSWORD=pass
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=nextcloud_mariadb
networks:
nginx-proxy:
ipv4_address: ‘IP’
db:
depends_on:
- mariadb
dns:
- 1.1.1.1
volumes:
- ./config:/config
- ./Nextcloud:/data
- ./nextcloud.log:/data/nextcloud.log
ports:
- 8888:80
restart: unless-stopped
logging:
driver: “json-file”
options:
max-file: “5”
max-size: “10m”

mariadb:
image: linuxserver/mariadb:arm32v7-latest
container_name: nextcloud_mariadb
environment:
- PUID=0000
- PGID=000
- TZ=Europe/London
- MYSQL_ROOT_PASSWORD=pass
- MYSQL_PASSWORD=pass
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
networks:
db:
volumes:
- ./db:/config

ports:

- 3306:3306

restart: unless-stopped
logging:
 driver: "json-file"
 options:
  max-file: "5"
  max-size: "10m"

networks:
nginx-proxy:
external:
name: nginx-proxy
db:

What other information is needed? Wow im sorry for this text formation. Trying to fix…