Score:1

How to connect cloudflare argo tunnel to wordpress

us flag

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

  1. deployed the ubuntu server on AWS and configured security group to use port 22,80,443

  2. SSH into the server, did the update thing. Added new user with sudo privileges and added support for him to login using SSH key

  3. 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.

  4. 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

  1. Now comes the part were I will configure argo tunnel.
  2. Install cloudflared daemon and install it and logined and cert was installed by cloudflared
  3. Created a tunnel
  4. 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
  1. Made a cname record for the tunnel in cloudflare account
  2. Installed cloudflared as service and run the tunnel
  3. 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!!

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.