Using the self hosting application but there is still the original unprotected fqdn

Related to

Access

What is the issue you’re encountering

I created a tunnel for a self-hosted Nextcloud and an Self-Hosted Application both are accessible.

What steps have you taken to resolve the issue?

This is the issue. I created a tunnel for my self-hosted Nextcloud. It works fine. I then created a
Self Hosted application with email authentication. That also works. Nextcloud is the hostname
along with nextcloud-security as the application name.
The problem is, how I can prevent the nextcloud hostname from being used and instead use the
nextcloud-security hostname?
It is pointless to have self-hosted application when you can by-pass it using the nextcloud hostname.

I have tried leaving the application subdomain field blank and just have the tld selected. When
creating the application. I don’t know how to resolve this.

May I ask if both Nextcloud and Self-hosted application use the same domain name?

E.g. main domain example.com is your Website, then Nextcloud is nextcloud.example.com while self-hosted app is app.example.com?

nextcloud.example.com and app.example.com are public hostnames configured and running via cloudflared tunnel?

How does your Access policy look like?

Since I wrote my post. I deleted everything and started from a clean slate. I also watched this YouTube video. I can’t link the video. The channel name is DB Tech and the title of the video is “Cloudflare Tunnels: Getting Started with Domains, DNS, and Tunnels.”

I am not allow (yet?) to post this many links so I had to replaced the . with the word dot.

I am using the same domain. I created it specifically for Cloudflare Tunnel and it is not used for any other public use. The tunnel is using nextcloud dot example dot com and the Self-hosted application has used nextcloud dot example dot com nextcloud-secure dot example dot com’.

I can access nextcloud via the public hostname nextcloud dot example dot com. After creating the Self-hosted application. When I visit nextcloud dot example dot com, it still shows the default Nextcloud login page. That is using nextcloud as the application name in the Self-hosted application.

If I use nextcloud-secure in the Self-hosted application. When going to nextcloud-secure dot example dot com it will show the email entry screen. I receive the email code and enter it on the page. Then it will give me a 404 obviously because nothing is at nextcloud-secure dot example dot com. As a test I added that FQDN to my allowed list in Nextcloud and copied the hostname that the tunnel created for Nextcloud in the nextcloud-secure cname record. When I did that, I got another 404 error.

What doesn’t make any sense is that I followed everything in the video. Except his worked and mine doesn’t.

My access policy is using email and I entered one of my email addresses. That by itself works but when it hands off the connection. It is not going to Nextcloud, it just has a 404.

Is that 404 coming from Cloudflare or origin? :thinking:

Are you using some kind of a reverse proxy on the origin or port forward, or running via container(s)?

The 404 isn’t a Cloudflare generated message. It is your standard http response.

I don’t have a proxy, forwarded ports, or containers. Cloudflared is running on a Ubuntu Server 22.04 as a systemd service using a native package.
Everything else is 100% Cloudflare.