Nextcloud on Synology NAS connected to pfSense

I’m having an issue making my Nextcloud accessible outside of my local network.

I am running pfSense on a Protectli vault. My Synology NAS has its own port from the vault. Nextcloud is installed on the NAS.

I’ve been trying to use ACME Certificates and HAProxy in pfSense with a domain from Cloudflare.

I’ve used a few YouTube videos, including the LTS videos on Nextcloud, HAProxy and Let’s Encrypt, and the HAProxy troubleshooting video.

I feel like I’ve got everything in pfSense configured correctly based on all of the videos. However, I can’t access Nextcloud with the domain name and when I dig the domain name I do not get the correct IP address. I do have the host override in the DNS Resolver.

I’m new to all of this and have been trying to learn and understand what I am doing, but I can’t seem to figure out this step. I keep going around in circles with this. I’m not even sure the right information to provide here.

Does anyone have suggestions for what to try? Is there anything within the Synology NAS I need to configure?

Thanks in advance.

Not sure if you have seen these.

Yeah, I’ve been through both videos several times. I’ve been going back through all of the settings in Cloudflare and HAProxy.

In Cloudflare I changed the proxy status to DNS only and now when I dig the hostname I get the right IP. Before I was getting Cloudflare IPs.

I’ve also gone back and forth in HAProxy and the pfSense DNS Resolver to make sure that things are pointing to the IP of pfSense where HAProxy is.

Currently, when I go to the host name, I get: 404 Bad Request, The plain HTTP request was sent to HTTPS port.

I’m not sure I’m any closer or not.

Thanks.

Are you using a cloudflare tunnel or are you just pointing the DNS record to your home IP address? Have you opened the correct ports on your firewall? Is your home IP a static public IP or are you behind CGNAT? I think you need to tell us more about the connection between cloudflare and your Synology machine.

I ended up reading somewhere else that someone who was getting the “The plain HTTP request was sent to HTTPS port.” message rebooted pfSense after making changes. I never rebooted, but just did and was able to reach Nextcloud.

Thanks for the responses.