Run multiple argo tunnel in same server

How can I run multiple argo tunnel as service, I can run only tunnel as service. And also if I enable multiple things like warp routing and multiple hostname then the connection to argo tunnel drops. So I want to create multiple argo tunnel. Also can I have multiple hostname to same localhost:80 or same port. I have multiple website that run on same port 443

1 Like

Overall the recommended way is to use a single tunnel with multiple ingress rules (see https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/configuration/configuration-file/ingress and https://blog.cloudflare.com/many-services-one-cloudflared/).

cloudflared service install will always create/install the same unit file. But nothing forbids you from taking it and adding more services that are essentially a clone of that, with a different name, and pointing to a different cloudflared config YAML.

This is not a known problem nor is it expected. Can you elaborate?

Yes, you can add as many DNS/LB routes pointing to your tunnel as you want. Then you can add as many ingress rules (for each hostname route) as you want, they may all point to the same origin if you want.

@nuno.diegues This happened on nginx server. My website was running on localhost:443

I added 2 hostname one for my website and one for my phpmyadmin both were running on the same localhost:443 but phpmyadmin shows 404 error.

Also when I turned on argo for my wordpress website there was a redirect loop when accessing example.com/wp-admin
The origin was configured to use cloudflared orgin SSL, no redirect were there from server. Then I put this code $_SERVER['HTTPS'] = 'on'; in wp-config and it solved. Is the right way @nuno.diegues

Can you share the configuration used for that tunnel?
Also, how did you set up DNS for that?

@nuno.diegues

tunnel: 5157d321-5933-4b30-938b-d889ca87e11b
credentials-file: /Users/samrhea/.cloudflared/5157d321-5933-4b30-938b-d889ca87e11b.json

ingress:
  - hostname: grafana.widgetcorp.tech
    service: https://localhost:443
  - hostname: blog.widgetcorp.tech
    service: https://localhost:443
  # Catch-all rule, which just responds with 404 if traffic doesn't match any of
  # the earlier rules
  - service: http_status:404

warp-routing:
  enabled: true

Somewhat same like this and used the CName setup for dns

@nuno.diegues I recreated the issue and now I am receiving bad gateway error when using argo tunnel.
Config file

tunnel: fc26afb6-d080-4966-a494-b6e5d6ae5813
credentials-file: /home/cloudcreatr/.cloudflared/fc26afb6-d080-4966-a494-b6e5d6ae5813.json
warp-routing:
  enabled: true
ingress:
  - hostname: test.cloudcreatr.com
    service: https://localhost:443
  # Catch-all rule, which just responds with 404 if traffic doesn't match any of
  # the earlier rules
  - service: http_status:404

There does not seem to exist any DNS record with this name. Did you miss this step? https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/routing-to-tunnel/dns