What I want to achieve
I want to use cloudflared daemon so that I can use cloudflare argo tunnel and connect the argo tunnel to my wordpress website so that I can protect the origin and see if there is any performance difference
What I done and why I want you to help me
I have my AWS ec2 server with nginx and cloudflare argo tunnel configured that proxies my traffic to the WordPress website through CName.
From below steps I followed, could you please tell me if it's the optimal steps or.
Something I can improve on or the step are perfect
Let's start, things I did
deployed the ubuntu server on AWS and configured security group to use port 22,80,443
SSH into the server, did the update thing. Added new user with sudo privileges and added support for him to login using SSH key
Logged in using new user, following these guide from digital ocean
https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04
https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-lemp-on-ubuntu-20-04
To install WordPress, nginx, MySQL, other php modules.
Connected domain to my server through cloudflare dns, SSL is set to full and installed orgin certificate Using this guide
https://www.digitalocean.com/community/tutorials/how-to-host-a-website-using-cloudflare-and-nginx-on-ubuntu-20-04
- Now comes the part were I will configure argo tunnel.
- Install cloudflared daemon and install it and logined and cert was installed by cloudflared
- Created a tunnel
- Made a config.yml file
tunnel: tunnel id
credentials-file: /home/user/.cloudflared/tunnel id.json
ingress:
- hostname: argo.example.com
- service: https://localhost:443
- service: http_status:404
- Made a cname record for the tunnel in cloudflare account
- Installed cloudflared as service and run the tunnel
- I changed the url from http to https in WordPress general settings and faced the redirect loop so I put this code in wp config
$_SERVER['HTTPS'] = 'on';
(not sure if this is a optimal way)
And it worked. Not sure if this is a optimal and perfect steps so please guide me and I am also confused if it should be https://localhost:443 or
http://localhost:443. (Will it not consume time to redirect if it's http)
Also should I install the cloudflare Orgin certificate as in step 4 because cloudflare argo installs a cert file.
All port are closed now!!