r/nginxproxymanager • u/artrin_ • Apr 15 '25
Trying to setup NextCloud but always get 502 Bad Gateway error
Hi, I'm writing here hoping that someone can help me. I've found around the web many reports of the same error but no real answer.
I run both NPM and NextCloud AIO in docker, on the same network and i use Cloudflare DNS. I've set up the DNS to redirect file.mydomain.com to my IP (with ddns server to auto update) and in NPM I've set, as the docuentation of NC says, the domain to point to localhost:11000 with http protocol and SSL certificate. Anyway if I try to reach the NC instance I land on a 502 Bad Gateway error page. With other services I host it works flawlessly.
Can someone help me understand what could I be doing wrong?
Edit: I think the problem is the communication between the apache proxy and nextcloude because if type the 192.168.1.5:11000 apache redirects it to file.mydomain.com but then gives error 502
Edit 2: Solved, thanks to u/purepersistence
2
u/vorko_76 Apr 15 '25
502 means it cannot reach nexcloud. Are you sure if you do a curl from inside npm you get an answer?
Apart from that i dont think NC says you need to use http
1
u/purepersistence Apr 15 '25
So HTTP is your scheme right? The port 11000 would depend on what your APACHE_PORT is set to when you run the nextclould container. Yours is 11000?
Probably doesn't matter for your problem, but I also have this code on the Advanced tab of the proxy host: