Cloudflare Tunnel with virtual hosts

Hello! I just setup a Cloudflare Tunnel behind a CGNAT. To test, I made a public hostname and now I can see the default page of Nginx, so it works! Woo! In this same machine I have some virtual hosts made, phpmyadmin.debian.example.com and pterodactyl.debian.example.com. I have the DNS records of these subdomains pointed to the local IP of the machine. Everything works as expected, I can access both of the apps without any issue in my local network. Next I tried adding these applications to my tunnel. I created a new public hostname phpmyadmindebian.example.com and added this same hostname to my Nginx site configuration. However, I only see the default page of Nginx in this new public hostname. Does Cloudflare tunnel doesn't work with virtual hosts? Is there any extra configuration I need to do? Thanks for your help
Solution:
If I put the local ip of the machine (http://192.168.100.90), rather than localhost in the service URL, it works!
Jump to solution
7 Replies
itaquito
itaquitoOP8mo ago
I also thought of running the apps on different ports and set the service URL of the tunnel to the new port. But I would prefer to run them on port 80 and just use different hostnames, if possible.
Loki
Loki8mo ago
It should be possible. What are your public hostnames and virtual host configs?
itaquito
itaquitoOP8mo ago
This is in my tunnel configuration
No description
itaquito
itaquitoOP8mo ago
and this is my site config
No description
itaquito
itaquitoOP8mo ago
phpmyadmin.debian.example.com is my local IP pointed subdomain. Which works! Wait a minute..
Solution
itaquito
itaquito8mo ago
If I put the local ip of the machine (http://192.168.100.90), rather than localhost in the service URL, it works!
itaquito
itaquitoOP8mo ago
Probably Nginx is doing something weird...
Want results from more Discord servers?
Add your server