Caddy 1.0.4 | Nextcloud(nginx) | /nextcloud/ subfolder | leads to 502 Bad Gateway

Hi there!

Thank you very much vor your help.
Indeed when I list all listening ports on the server there is no fastcgi listening on Port 9000. One look at phpinfo.php shows that PHP-FPM/fcgi is active/enabled and used, but not over any port. As @besendorf said, this is most likely handled by nginx.

I replaced then the fastcgi block in the caddy file with the line proxy / nginx:8080 as @besendorf (scheint wohl ein ein ziemlich sauberes Dorf zu sein! :slight_smile: ) suggested but I have the same issue with bad gateway.

I looked then in /var/log/nextcloud_errors.log for any errors and this is what I get:

root@DietPi4:~# cat /var/log/nextcloud_errors.log 
2020/01/31 11:20:46 [ERROR 502 /index.php/] dial tcp: lookup nginx on 192.168.5.1:53: no such host
2020/01/31 11:20:46 [ERROR 502 /index.php/favicon.ico] dial tcp: lookup nginx on 192.168.5.1:53: no such host
2020/01/31 11:22:53 [ERROR 502 /index.php/] dial tcp: lookup nginx on 192.168.5.1:53: no such host
2020/01/31 11:22:53 [ERROR 502 /index.php/favicon.ico] dial tcp: lookup nginx on 192.168.5.1:53: no such host

.

So it seems that caddy is trying to reach nginx on Port 53 on my Gateway/Router instead on the server itself.

There is no line in the Caddyfile where I have put the IP of my Router/Gateway in. So it seems that caddy is trying to reach the nginx Server on the DNS-Server Port of my Router. That is some odd behavior. Or did I miss here something?!

Have a nice weekend and thank you very much for your help! :slight_smile: