Currently there is no service running on the domain name. However, when I now try to access my web server via both lan and wan I kept getting error 503 service not available.
# Backend: cloud_backend ()backend cloud_backend # health checking is DISABLED mode http balance source # stickiness stick-table type ip size 50k expire 30m stick on src # tuning options timeout connect 30s timeout server 30s http-reuse safe server cloud_server 192.168.7.5:80 ssl verify required ca-file /etc/ssl/cert.pem
server cloud_server 192.168.7.5:80 ssl verify required ca-file /etc/ssl/cert.pem
A second question I have, single post above you talk about "You have to put the OPNsense LAN IP in the DNS overide. Not the IP of the service." I am confused about this piece, is it possible to explain a little more about this.
Thank you much for this amazing tutorial. I have referred a few people from reddit to this.Questions I hope someone can help me with: If I have xdomain.com, xczxdomain.com and ltsdomain.com; does this support multi domain usage?can I use this tutorial to assign a particular domain for a given service?do I need to recreate the whole entries for each or at which point do I make the adjustment?
global uid 80 gid 80 chroot /var/haproxy daemon stats socket /var/run/haproxy.socket group proxy mode 775 level admin nbproc 1 nbthread 1 hard-stop-after 60s no strict-limits maxconn 10 tune.ssl.default-dh-param 2048 spread-checks 2 tune.bufsize 16384 tune.lua.maxmem 0 log /var/run/log local0 info lua-prepend-path /tmp/haproxy/lua/?.luadefaults log global option redispatch -1 maxconn 10 timeout client 30s timeout connect 30s timeout server 30s retries 3 default-server init-addr last,libc# autogenerated entries for ACLs# autogenerated entries for config in backends/frontends# autogenerated entries for stats# Frontend: 0_SNI_frontend (listens on 80, 443, 853, 5000)frontend 0_SNI_frontend bind 0.0.0.0:80 name 0.0.0.0:80 bind 0.0.0.0:443 name 0.0.0.0:443 bind 0.0.0.0:853 name 0.0.0.0:853 bind 0.0.0.0:5000 name 0.0.0.0:5000 mode tcp default_backend SSL_backend # tuning options timeout client 30s # logging options# Frontend: 1_HTTP_frontend (listening on 192.168.5.100:80 i.e. http only)frontend 1_HTTP_frontend bind 192.168.5.100:80 name 192.168.5.100:80 accept-proxy mode http option http-keep-alive option forwardfor # tuning options timeout client 30s # logging options # ACL: NoSSL_Condition acl acl_619439805021f2.97978352 ssl_fc # ACTION: HTTPtoHTTPS_rule http-request redirect scheme https code 301 if !acl_619439805021f2.97978352# Frontend: 1_HTTPS_frontend (Listening on 192.168.5.100:443)frontend 1_HTTPS_frontend http-response set-header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" bind 192.168.5.100:443 name 192.168.5.100:443 accept-proxy ssl curves secp384r1 no-sslv3 no-tlsv10 no-tlsv11 no-tls-tickets ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES256-GCM-SHA384 ciphersuites TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256 alpn h2,http/1.1 crt-list /tmp/haproxy/ssl/61952b9d47d700.25962675.certlist bind 192.168.5.100:5000 name 192.168.5.100:5000 accept-proxy ssl curves secp384r1 no-sslv3 no-tlsv10 no-tlsv11 no-tls-tickets ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES256-GCM-SHA384 ciphersuites TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256 alpn h2,http/1.1 crt-list /tmp/haproxy/ssl/61952b9d47d700.25962675.certlist mode http option http-keep-alive option forwardfor # tuning options timeout client 15m # logging options # ACTION: PUBLIC_SUBDOMAINS_map-rule # NOTE: actions with no ACLs/conditions will always match use_backend %[req.hdr(host),lower,map_dom(/tmp/haproxy/mapfiles/619521e7265391.88020289.txt)] # Frontend: 1_TCP_frontend (Listening on 192.168.5.100:853)frontend 1_TCP_frontend bind 192.168.5.100:853 name 192.168.5.100:853 accept-proxy ssl curves secp384r1 no-sslv3 no-tlsv10 no-tlsv11 no-tls-tickets ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES256-GCM-SHA384 ciphersuites TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256 alpn h2,http/1.1 crt-list /tmp/haproxy/ssl/61dc51606078d9.11258474.certlist mode tcp default_backend nginx_backend-tcp # tuning options timeout client 15m # logging options option tcplog # ACTION: PUBLIC_SUBDOMAINS_map-rule # NOTE: actions with no ACLs/conditions will always match use_backend %[req.hdr(host),lower,map_dom(/tmp/haproxy/mapfiles/619521e7265391.88020289.txt)] # Backend: SSL_backend ()backend SSL_backend # health checking is DISABLED mode tcp balance source # stickiness stick-table type ip size 50k expire 30m stick on src # tuning options timeout connect 30s timeout server 30s server SSL_server 192.168.5.100 send-proxy-v2 check-send-proxy# Backend: nginx_backend-tcp ()backend nginx_backend-tcp # health checking is DISABLED mode tcp balance source # stickiness stick-table type ip size 50k expire 30m stick on src # tuning options timeout connect 30s timeout server 30s server nginx_2 192.168.5.1:8054 resolve-prefer ipv4 send-proxy check-send-proxy# Backend: bastion_backend (bastion_backend)backend bastion_backend # health checking is DISABLED mode http balance source # stickiness stick-table type ip size 50k expire 30m stick on src # tuning options timeout connect 30s timeout server 30s http-reuse safe server bastion-1 192.168.5.157:5000
root@OPNsense:~ # sockstat -4 -l | grep lighttpdroot lighttpd 28364 6 tcp4 192.168.1.65:443 *:*root lighttpd 28364 8 tcp4 192.168.1.1:443 *:*root lighttpd 28364 10 tcp4 192.168.1.65:80 *:*root lighttpd 28364 12 tcp4 192.168.1.1:80 *:*root sshd 84263 5 tcp4 192.168.1.1:22 *:*root@OPNsense:~ # /usr/local/etc/rc.d/haproxy startStarting haproxy.[ALERT] (2036) : Starting frontend 1_HTTP_frontend: cannot bind socket (Can't assign requested address) [192.168.1.65:80][ALERT] (2036) : Starting frontend 1_HTTPS_frontend: cannot bind socket (Can't assign requested address) [192.168.1.65:443][ALERT] (2036) : [/usr/local/sbin/haproxy.main()] Some protocols failed to start their listeners! Exiting./usr/local/etc/rc.d/haproxy: WARNING: failed to start haproxy
root@OPNsense:~ # /usr/local/etc/rc.restart_webguiStarting web GUI...done.Generating RRD graphs...done.root@OPNsense:~ # sockstat -4 -l | grep lighttpdroot lighttpd 64654 6 tcp4 192.168.10.65:443 *:*root lighttpd 64654 8 tcp4 192.168.1.1:443 *:*root lighttpd 64654 10 tcp4 192.168.10.65:80 *:*root lighttpd 64654 12 tcp4 192.168.1.1:80 *:*root sshd 84263 5 tcp4 192.168.1.1:22 *:*root@OPNsense:~ # /usr/local/etc/rc.d/haproxy startStarting haproxy.[ALERT] (18033) : Starting frontend 1_HTTP_frontend: cannot bind socket (Address already in use) [192.168.10.65:80][ALERT] (18033) : Starting frontend 1_HTTPS_frontend: cannot bind socket (Address already in use) [192.168.10.65:443][ALERT] (18033) : [/usr/local/sbin/haproxy.main()] Some protocols failed to start their listeners! Exiting.
I am trying to follow the instructions to enable HAProxy for internal domains. However, I can't seem to get the frontend listener for the virtual ip to work. Service binding is disabled for the virtual ip.When the frontend listener for the virtual ip is enabled:1. haproxy cannot start (when webgui is running).2. webgui cannot start (when haproxy is running).
Then tried the rule on the SNI frontend, the http frontend and https frontends. Essentially all frontends trying to make the exception there but in all cases after the sni, the http to https rule gets evaluated first, defeating any exception I've tried.If it's not too much a deviation, could I have a suggestion on how to approach it? In sum, I'm looking for a way to route my http custom port to a back end as an exception in this Tutorial setup.
However, there is an instance where it would be very nice to be able to white-list one (or a couple) of specific IPs, so that I could access my services at home from my office. I am not able to install software at the office, and there are other restrictions preventing me from using a VPN.
Quote from: cookiemonster on August 19, 2022, 04:02:03 pmThen tried the rule on the SNI frontend, the http frontend and https frontends. Essentially all frontends trying to make the exception there but in all cases after the sni, the http to https rule gets evaluated first, defeating any exception I've tried.If it's not too much a deviation, could I have a suggestion on how to approach it? In sum, I'm looking for a way to route my http custom port to a back end as an exception in this Tutorial setup.The order of the rules is important! Make sure that all "http-redirect-to-backend" rules are placed BEFORE the HTTPtoHTTPS rule on the HTTP_frontend.
[WARNING] (96704) : parsing [/usr/local/etc/haproxy.conf.staging:74] : a 'http-request' rule placed after a 'use_backend' rule will still be processed before.Warnings were found.Configuration file is valid
Quote from: TheHellSite on August 30, 2022, 01:41:06 pmQuote from: cookiemonster on August 19, 2022, 04:02:03 pmThen tried the rule on the SNI frontend, the http frontend and https frontends. Essentially all frontends trying to make the exception there but in all cases after the sni, the http to https rule gets evaluated first, defeating any exception I've tried.If it's not too much a deviation, could I have a suggestion on how to approach it? In sum, I'm looking for a way to route my http custom port to a back end as an exception in this Tutorial setup.The order of the rules is important! Make sure that all "http-redirect-to-backend" rules are placed BEFORE the HTTPtoHTTPS rule on the HTTP_frontend.Thank you. Unfortunately I haven't been able to do this. The exact warning is:Code: [Select][WARNING] (96704) : parsing [/usr/local/etc/haproxy.conf.staging:74] : a 'http-request' rule placed after a 'use_backend' rule will still be processed before.Warnings were found.Configuration file is validAny other ideas are welcome
I've been following this wonderfully crafted tutorial, so "THANK YOU" to the op for this.Question (I know this might outside the scope of this tutorial):If I want HAProxy to handle *.my1stdomain.xyz which would be for specific services (already have this working flawlessly), but I would like to forward *.my2nddomain.xyz to nginx proxy manager running on docker so that nginx proxy manager will be used to manage that.Is that something this setting can help to implement?