Two Domains on Nginx Server Blocks with Argo Tunnel


#1

We have multiple websites ( x2 ) both use CF and are on paid plans. We run them on Nginx in server blocks and want to add Argo Tunnel however is is possible to run both domains using the Tunnel considering both are on the same virtual machine ? By the way they are different root domains.


#2

:wave: @Ben

Haven’t tried but looks like you can with a CNAME.

The way to do this is to start Tunnel on one hostname, then in the Cloudflare DNS editor, create CNAME records from the other hostnames you’d like to be passed back to Tunnel that point to the Tunnel’ed hostname.
https://developers.cloudflare.com/argo-tunnel/reference/multiple-hostnames/

But if different domains for each website think it requires 2 tunnels.

-OG


#3

HI Oliver.

Thank you for the reference.
While the CNAME would be possible it appears as you state that it requires one tunnel per domain which I am unsure if two tunnels can be run on the same machine as having a virtual machine just for one website is a little overkill and I would be surprised if there is not some other solution. I will do some testing tomorrow to see of two tunnels can be run on the one server but I am not confident that is will be possible…I will advise of the outcome tomorrow…fingers crossed.


#4

It is possible, but I think only one instance can run as a service. Not sure if there are good script examples for initializing tunnels on start-up or not.

-OG