Nextcloud + swag problem

Hello there!

So after google’ing for 3 days i give up and ask the wise ones of this forum.

The problem is that when i try to access my nextcloud service from a duckdns subdomain, i get the folowing error in my browser: “502 Bad Gateway”. Jellyfin works super fine though, which is why I’ve included my swag config for it).





nextcloud config.php






(just to show a config file of a container working with swag atm)



I’ve included the entire compose file, even though most of it isn’t relevant. But maybe you can spot some conflicts i can’t.

Note: I’m not using linuxserver/nextcloud, but rather nextcloud official.

My hardware:

  • Raspberry Pi 4. 2GB connected to my isp router with cable.
  • Raspberry Pi OS 32-bit
  • Open Media Vault (docker installed and running from here with portainer)
  • RetroPie

Docker compose file is run as a stack in portainer.

I actually was able to get access from my duckdns subdomain once, by replacing port “8080” with “80” in the “nextcloud.subdomain.conf”, (which doesn’t really make sense since I’m exposing port 8080 in the compose file. Or does it? :thinking:) and adding the suggested settings from top of “nextcloud.subdomain.conf.sample” to “nextcloud config.php” as follows:


‘trusted_proxies’ => [‘swag’],

‘overwrite.cli.url’ => ‘’,

‘overwritehost’ => ‘’,

‘overwriteprotocol’ => ‘https’,

I reverted the settings as it seemed slow and “not feeling right” since the port is wrong??? Again im not sure?

I don’t have any SSL certificates setup in nextcloud config, hence the “http” instead of “https” in the “nextcloud.subdomain.conf”.

Thank you in advance!

I am trying to access nextcloud through nextcloud.mysubdomain.duckdns.NOT-A-LINK-OMG

I have tried from Microsoft Edge (pc), Firefox (pc) and Firefox Android.

I’m sorry, but you have to add a dot between “pastebin” and “com” ( by yourself. Apparently new users are not allowed to post more than 2 links.

502 means swag can’t reach nextcloud. Most likely because you modified the port. Don’t. Swag connects directly through the docker network, so it connects to the container port, not the host mapped port.

1 Like

Thank you. This explains why I could use port 80 I see. So should/can I use 443 even though I don’t have ssl/https enabled in nextcloud?

Or is my speed problem related to something else perhaps? I don’t have redis installed, and I’ve wondered if that could be my problem maybe?


Don’t just bump the message by pinging someone’s username.

You didn’t say anything about a slow down before. That’s an entirely different issue. Check your plugins, one of them may be causing it.

Yeah sry the post was done in big frustration 6am in the morning after a night shift.

When I upload to nextcloud on local ip or dns name is the same - ok speeds at first, but then it stops for a few seconds, picks up speed again, and eventually dies out and I can’t even cancel it. By navigating away it stops up/downloading and speed is fine again.

I suspect permissions, or apache/nextcloud too resource hungry for pi 4 hardware? Jellyfin is build around nginx which is working great, with great speeds (maxing out my wan upload speed of 60mbit/s).

Or maybe it’s the absence of redis?