Cant connect to the cloudflare with A - DNS

My ubuntu server work correctly in port 80 using nginx, it’s finally switch to port:3000 for Nodejs app to run. Everything okay when i pass the dns to the browser but when I try to connect with Cloudflare It’s appear the 502 bad gateway code when access the domain name? I’m kind of new in cdn hosting please tell me what to do! Many thanks My Cloudflare Setup

My cloudrlare setup


Thank you for asking.

May I ask if you’re using proxy_pass on your Nginx due to the NodeJS running on 3000 while Nginx on 80 (HTTP)? :thinking:

3000 won’t work by default with proxied :orange: hostname:

A bit of code I’ve got here despite different topic related to the Websocket:

May I ask what SSL option have you got selected under the SSL/TLS tab at Cloudflare dashboard for your domain ( Flexible, Full, Full Strict … )?

Regarding the SSL, are you planning to use HTTP or HTTPS with Cloudflare for your domain name? :thinking:

When unproxied :grey: (DNS-only), it works normally?

1 Like

Thank you for your recommendation in SSL/TLS
It’s really does work when I change the FULL to FLEXIBLE. But It’s that the right choice and if I want to upgrade to full what should I do

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