I have tried adding a user and password to 'User management' & ticking the box for Basic auth in the backend and selecting my user, no luck sadly. I'm pretty sure I just have to add an option somewhere to pass the auth header, however, I can't figure it out. Googling for the problem just leads to info on how to setup HAproxy to do basic auth, which I don't need... The logs also don't seem to show anything useful.Anyone has any ideas? Thanks in advance.
The user management in HAProxy has nothing to do at all with any login forms of services that are behind HAProxy! You can use this to add a login form that pops up before the client can even connect to the service that is behind HAProxy. So unrelated to your issue.
Apart from that please ask in the official HAProxy forums about your issue since it is not related to my tutorial.
I assume the HAProxy is also listening on the LAN interface?
thank you for your help!
In the DSM control panel, go to security, at the bottom is "trusted proxies". Add the dsm ip address HAProxy IP address, and boom! The correct external IP address is logged at a connection attempt and you will get notified about new login behavior if you have that turned on, and ip address blocking should now work if you have that turned on.
user@OPNsense:~ $ wget --save-headers http://nas.mydomain.com:8080--2023-01-08 12:47:22-- http://nas.mydomain.com:8080/Resolving nas.mydomain.com (nas.mydomain.com)... 192.168.5.60Connecting to nas.mydomain.com (nas.mydomain.com)|192.168.5.60|:8080... connected.HTTP request sent, awaiting response... 200 OKLength: 580 [text/html]Saving to: 'index.html'index.html 100%[=====================================================================================>] 580 --.-KB/s in 0s2023-01-08 12:47:22 (139 MB/s) - 'index.html' saved [580/580]
user@OPNsense:~ $ wget --save-headers https://nas.mydomain.com--2023-01-08 13:01:21-- https://nas.mydomain.com/Resolving nas.mydomain.com (nas.mydomain.com)... 192.168.5.60Connecting to nas.mydomain.com (nas.mydomain.com)|192.168.5.60|:443... connected.ERROR: cannot verify nas.mydomain.com's certificate, issued by 'CN=R3,O=Let\'s Encrypt,C=US': Unable to locally verify the issuer's authority.To connect to nas.mydomain.com insecurely, use `--no-check-certificate'.
user@OPNsense:~ $ wget --save-headers https://mydomain.com--2023-01-08 13:13:59-- https://mydomain.com/Resolving mydomain.com (mydomain.com)... 185.176.xxx.xxx [WAN IP]Connecting to mydomain.com (mydomain.com)|185.176.xxx.xxx [WAN IP]|:443... connected.HTTP request sent, awaiting response... 503 Service Unavailable2023-01-08 13:13:59 ERROR 503: Service Unavailable.
My default LAN interface has "192.168.10.1/24" so i created a host override f.e. "mynas.mydomain.com" pointing to 192.168.10.1.I assume the HAProxy is also listening on the LAN interface?
Hi, attached you can find my haproxy.conf and map file.I replicated your tutorial 1:1The OPNsense firewall LAN IP is 192.168.10.1for the 2 items in the map file i created a DNS override for those FQDN's pointing to 192.168.10.1access from the internet works fine. The wildcard ssl cert is being used and the port redirection works and is not visible. (ex :55443 for the firewall interface and :5000 for the NAS)internally the browser says "ERR_CONNECTION_TIMED_OUT" and nothing is displayed.If you need more info or details i'll be happy to provide them to you.thank you for your help!
TheHellSite, thanks a lot for all the work that you've put into this tutorial. I have followed every step of it and almost everything is working well.One issue I am facing is that when I ping a local domain (e.g. opnsense.mydomain.com (router/fw box), nas.mydomain.com (qnap nas)) the IP gets resolved as my external WAN IP address.
@TheHellSideFirst thank you for this wonderful guide. I learned a lot of and it helps to understand everything a little bit better.At the moment I play around with these features to understand it even better.My setup is a bit different so I need to play around with it and see what happens.At the moment lets encrypt is working and HAProxy is configured. And here I have some questions in general:1. Why do I have to open port 80 and 443 when using DNS-01 challenge ? I thought that is NOT needed and that was the reason why I choose DNS012. I DIDNT make the internal procedure BUT I can access the configured backend internally without any problems via the name !!! BUTa. in Safari i get an ssl certificate (it is a self signed ssl certificate from my router)b. in firefox it is still unsecured Why is that ? If I have to send to you some information please let me know but I think that are general questions and no files / screenshots are needed or ?