Argo tunnel is not working over SSL for my hostname

Hi Team,

My setup is as below:

User>CF>NGINX:443> Express JS : 3000
Here nginx is forwarding traffic to node running on 3000, this setup is working fine with argo

Argo tunnel is working if i dont specify my domain name so cloudflared gives me random url through which i can access my webserver however once i put the hostname in the command of argo tunnel, it does not work.

The command and output is as below:

cloudflared tunnel --url https://localhost:443 --origin-server-name hjain.tech --hostname hjain.tech

I have tried the command with all command-switches however nothing seems to work for me.

It does say connected to SIN/NRT/SIN/NRT and finally Route propagating, it may take up to 1 minute for your new route to become functional

cloudflared tunnel --url https://localhost:443 --origin-server-name hjain.tech --hostname hjain.tech
Route propagating, it may take up to 1 minute for your new route to become functional

I have waited more than one minute and tried to access my web hjain.tech but i only see “DNS_PROBE_FINISHED_NXDOMAIN” in the browser.
I have tried with Linux/Windows and without nginx and with nginx.
Am i doing something wrong here?

Try tunnel directly to express, nginx is not needed here. Best practice set your expressjs server to 127.0.0.1 then http://127.0.0.1:3000/

cloudflared tunnel --url http://localhost:3000/ --origin-server-name hjain.tech --hostname hjain.tech

Thanks it did work from command line.

What would be the correct command line argument in yml for --origin-server-name to put inside the config.yml.

I have tried few ways but it dint work.

Logs
[2020-07-11T09:26:35.867124686Z]: HTTP request error: Error proxying request to origin: x509: certificate is valid for *.hjain.tech, hjain.tech, not localhost

It should be:

origin-server-name: hjain.tech

See https://developers.cloudflare.com/argo-tunnel/reference/config/ for the config file format and https://developers.cloudflare.com/argo-tunnel/reference/arguments/ for CLI options.

I tried that, Let me try again. Thanks

Thanks its working. I also made some permissions changes at my end.
I can see in config > logs

Environment variables map[config:/etc/cloudflared/config.yml hostname:hjain.tech logfile:/var/log/cloudflared.log loglevel:warn no-autoupdate:true origin-server-name:hjain.tech