How to connect argo tunnel to the WordPress website

You don’t need this when you configured your server for port 443 properly. I tried with spinupwp and they did wordpress config with nginx and the Cloudflare Tunnel was running awesome on port 443 without the code

    if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
        $_SERVER['HTTPS'] = 'on';

No you don’t need this code if you have configured you server to respond to port 443

I received this error because the Orgin server was not properly configured for port 443, I tested a new nginx server with spinupwp and the Cloudflare Tunnel works great without any extra config

This is also due to misconfigered https and port 443.
When you have successfully configured server for port 443 and https. the Cloudflare Tunnel will connect to the WordPress website on nginx without any problems

Set noTLSVerify: true in your cloudflare Cloudflare Tunnel config

You require orgin certificate. Even if you are using cloudflare Cloudflare Tunnel to connect with WordPress on port 443

Dont use cloudflare authicated orgin pull with cloudflared Cloudflare Tunnel

This is because I didn’t remove the default nginx page ‘welcome page’ so it’s recommended to remove that, after this I was facing bad gateway error that is due to misconfigered https and port 443

@eva2000 @nuno.diegues thanks a lot for the help

This error I got after following tye digital ocean guide on LEMP and WordPress nginx setup never the less it gave a lot of experience.

I recommend following spinupwps guide to install WordPress and nginx