502 error using certbot certificates

Hello, I have a service running on port 4081 with self signed certificates to be able to be accessed from the local network.

On top of that I deployed an nginx reverse proxy to be able to access the service running on that port (4081) directly through a browser, and I’ve issued a certbot --nginx certificate on top of it.

Then I’ve created an A domain pointing to my IP from the cloudflare dashboard, but I keep getting either a 502 bad gateway (host error) when I’m proxying through cloudflare, and 502 bad gateway (cloudflare error) when not proxying, just DNS.

Is there any conflicts if I issue my own certbot certificates?

This would be an issue with your dns cache. You cannot see a Cloudflare error when requests are sent directly to your server.

You can try whether it’s working with the following command:
curl -v https://example.com --connect-to ::actual-server-ip

As for the rest, there’s really not much useful information to go on. What ports is nginx listening on? Does access from the local network (via nginx) work?

Using the certificate wouldn’t cause problems. However, running certbot behind Cloudflare requires additional setup if you use the HTTP challenge.

Thank you, I’ve finally managed to serve my website through a cloudflared tunnel, which previously was also encountering some conflicts due to the self signed certificate, but when deleting it the tunnel works flawlessly.

Cheers

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