I have a Raspberry Pi 4 running an NGINX web server which I wanted to expose publicly via my own custom domain purchased from GoDaddy. I setup my custom domain using Cloudflare’s nameservers.
I decided to use Cloudflare Tunnels to access my web server via my own custom domain. However, I get an error, when I try to add a public hostname to port 80. (I am not bothered with https on port 443 for now.)
I am not sure what I am doing wrong. I was able to add other public hostnames with subdomains, like plex.mydomain.com but I want my NGINX web server to point to www.mydomain.com.
The error is quite clear. You already have that hostname allocated in DNS. You can’t have a tunnel and a DNS record for the same hostname. Delete the DNS record, and your tunnel should automatically fill that slot.
I still do have one small issue though. I am hosting 2 websites on my Raspberry Pi 4. I have 2 domains, mydomain.com and mydomain2.com, and the NGINX web server configuration handles which sites to serve.
I’ve set up the tunnel, the DNS records for mydomain.com and mydomain2.com like so:
http://mydomain.com - works
https://mydomain.com - works
http://www.mydomain.com - redirects to https://www.mydomain.com
https://www.mydomain.com - doesn't work
http://home-assistant.mydomain.com - works
https://home-assistant.mydomain.com - works
http://plex.mydomain.com - works
https://plex.mydomain.com - works
http://mydomain2.com - works
https://mydomain2.com - works
http://www.mydomain2.com - works
https://www.mydomain2.com - works
Any ideas what is wrong with:
http://www.mydomain.com - redirects to https://www.mydomain.com
https://www.mydomain.com - doesn't work
I get the error www.mydomain.com redirected you too many times.