Can I use Cloudflare Tunnel with CNAMEs to expose a database server?

Responsive Ad Header

Question

Grade: Education Subject: Support
Can I use Cloudflare Tunnel with CNAMEs to expose a database server?
Asked by:
68 Viewed 68 Answers

Answer (68)

Best Answer
(529)
Yes, you can use Cloudflare Tunnel with CNAMEs to expose a database server, but with caution. It's generally recommended to avoid exposing database servers directly to the internet. Instead, you should create a secure API layer in front of the database and expose that API layer through the Cloudflare Tunnel. This adds an extra layer of security and allows you to control access to your database. You'll point the CNAME to the Tunnel, and the Tunnel will route traffic to your API, which then communicates with the database.