502 error with nextcloud snap

Dear community! I am running into an issue i cant seem to resolve/troubleshoot myself :slight_smile:

- explain what you are trying to do,
Use caddy to reverse proxy to different backends. Got parts working. Only reverse proxying to nextcloud snap doesnt work.

The part of my caddyfile:
wouterverduin.nl {
proxy / {

- show what you have already tried,

  • In the nextcloud snap; added localhost to trusted_proxies as required by the snap
  • curl -ILH wouterverduin.nl → Empry reply from server ( with e.g. other service it gets an reply with similar command)

- include error messages and log output,
04/Jun/2019:17:13:30 +0200 [ERROR 502 /favicon.ico] EOF
04/Jun/2019:17:16:07 +0200 [ERROR 502 /index.php/204] EOF

Are there further ways to troubleshoot this? more precise: Is there a way to find out if the problem is within caddy or the nextcloud snap?

1 Like


For future reference to my fellow hobbyists.

Managed to stumble upon the answer with some testing around. I got it solved by disabling https for the snap since it isnt needed as it is handled by caddy.
The trusted_proxies setting was left in place in the snap. Pointed the caddyfile to the http port and it worked!

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.