Does cloudflare only manages HTTP and HTTPS ports
I have a VPS configured with Cloudflare using Nginx. This same VPS hosts a Postgres database on port 5432. However, I'm encountering issues when attempting to connect to the Postgres database. If I use the domain name as the host, I receive a timeout error. Conversely, if I use the direct IP, an ERR_Connection_Refused error appears. Could anyone suggest a solution for these issues?
2 Replies
Cloudflare only proxies HTTP and HTTPS traffic by default. They way it does that is that, if someone visit your website they first get sent to CF, then CF requests the website from your webserver. This redirection means that, if you're hosting something other than HTTP or HTTPS, such as postgres, it will not arrive on its destination.
You can turn off proxying (in the DNS settings, click the orange cloud next to the record to make it grey), but then your site will not be protected by Cloudflare. If you can manage with just inputting the raw IP for the database connection, I would do that. If not, you can make a DNS record like "db.yourdomain.example", and set that to not proxied.
i see thanks for the clarification