FIRST: You should remove your personal info from your post.SECOND: Another issue from not properly reading my guide.Your solution is in Part 5 - Step 6.QuoteNow we create the backend that belongs to an actual service. You will need one backend for each service.If you have multiple servers serving the exact same content than you will want to add all servers into a single backend so HAProxy can actually balance the load between the servers.YOU NEED: ... one backend for each service.YOU DID: ... one backend for each server hosting individual services.Just think about it... How should HAProxy even be able to talk to one of your services when you are only pointing him to the IP:Port of the server virtually hosting the service!? This makes no sense...It is like telling someone "Meet me in New York in a bar." without telling him which bar.
Now we create the backend that belongs to an actual service. You will need one backend for each service.If you have multiple servers serving the exact same content than you will want to add all servers into a single backend so HAProxy can actually balance the load between the servers.
#public subdomains mappingflood 5erver_backendfrank 5erver_backendwww 5erver_backendtorrent 5erver_backendgrafana 5erver_backendnas 5erver_backendkvm 5erver_backendmonitoring 5erver_backendspeedtest 5erver_backendsync 5erver_backendtracker 5erver_backendcloud NAS_backenddav NAS_backend
nas 5erver_backend
www 5erver_backend
grafana 5erver_backend
cat haproxy.conf## Automatically generated configuration.# Do not edit this file manually.#global uid 80 gid 80 chroot /var/haproxy daemon stats socket /var/run/haproxy.socket group proxy mode 775 level admin nbproc 1 nbthread 4 hard-stop-after 60s no strict-limits maxconn 10000 tune.ssl.default-dh-param 4096 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 5000 timeout client 30s timeout connect 30s timeout server 30s retries 3 default-server init-addr last,libc default-server maxconn 5000# autogenerated entries for ACLs# autogenerated entries for config in backends/frontends# autogenerated entries for stats# Frontend: O_SNI_fronted (Listening MYIP:80 MYIP:443)frontend O_SNI_fronted bind MY IP:80 name MYIP:80 bind MY IP:443 name MY IP:443 mode tcp default_backend SSL_backend # tuning options timeout client 30s # logging options# Frontend: 1_HTTP_frontend (Listening 192.168.1.1:80)frontend 1_HTTP_frontend bind 192.168.1.1:80 name 192.168.1.1:80 accept-proxy mode http option http-keep-alive option forwardfor # tuning options timeout client 30s # logging options # ACL: NO_SSL_Rule acl acl_620808a860e296.91534155 req.ssl_ver gt 0 # ACTION: HTTP_TO_HTTPS_RULE http-request redirect scheme https code 301 if !acl_620808a860e296.91534155# Frontend: 1_HTTPS_frontend (Listening 192.168.1.1:443)frontend 1_HTTPS_frontend http-response set-header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" bind 192.168.1.1:443 name 192.168.1.1: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/6208140971a7a3.08696099.certlist mode http option http-keep-alive # tuning options timeout client 15m # logging options # ACTION: PUBLIC_MAP_RULE # NOTE: actions with no ACLs/conditions will always match use_backend %[req.hdr(host),lower,map_dom(/tmp/haproxy/mapfiles/620809e036a6d1.87483247.txt)] # Backend: SSL_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.1.1 send-proxy-v2 check-send-proxy# Backend: blog_server_backend (Server backend blog)backend blog_server_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 5erver_Server_80 192.168.1.100:80 send-proxy-v2 check-send-proxy# Backend: cloud_nas_backend (cloud backend NAS)backend cloud_nas_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 nas_Server_80 192.168.1.118:80 send-proxy-v2 check-send-proxy# Backend: dav_nas_backend (dav backend NAS)backend dav_nas_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 nas_Server_80 192.168.1.118:80 send-proxy-v2 check-send-proxy# Backend: frank_server_backend (Server backend frank)backend frank_server_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 5erver_Server_80 192.168.1.100:80 send-proxy-v2 check-send-proxy# Backend: flood_server_backend (Server backend flood)backend flood_server_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 5erver_Server_80 192.168.1.100:80 send-proxy-v2 check-send-proxy# Backend: sync_server_backend (Server backend sync)backend sync_server_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 5erver_Server_80 192.168.1.100:80 send-proxy-v2 check-send-proxy# Backend: monitoring_server_backend (Server backend monitoring)backend monitoring_server_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 5erver_Server_80 192.168.1.100:80 send-proxy-v2 check-send-proxy# Backend: kvm_server_backend (Server backend kvm)backend kvm_server_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 5erver_Server_80 192.168.1.100:80 send-proxy-v2 check-send-proxy# Backend: nas_server_backend (Server backend nas)backend nas_server_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 5erver_Server_80 192.168.1.100:80 send-proxy-v2 check-send-proxy# Backend: tracker_server_backend (Server backend tracker)backend tracker_server_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 5erver_Server_80 192.168.1.100:80 send-proxy-v2 check-send-proxy
#public subdomains mappingflood flood_server_backendfrank frank_server_backendgrafana grafana_server_backendnas nas_server_backendkvm kvm_server_backendmonitoring monitoring_server_backendsync sync_server_backendtracker tracker_server_backendcloud cloud_nas_backenddav dav_nas_backend
#public subdomains mappingflood WEBSERVER_backendfrank WEBSERVER_backendwww WEBSERVER_backendtorrent WEBSERVER_backendgrafana WEBSERVER_backendnas WEBSERVER_backendkvm WEBSERVER_backendmonitoring WEBSERVER_backendspeedtest WEBSERVER_backendsync WEBSERVER_backendtracker WEBSERVER_backendcloud NAS_backenddav NAS_backend
WEBSERVER_backend --> contains --> WEBSERVER_serverWEBSERVER_server=192.168.1.100:80NAS_backend --> contains --> NAS_serverNAS_server=192.168.1.118:80
# WEBSERVER_backendflood.yourdomain.comfrank.yourdomain.comwww.yourdomain.comtorrent.yourdomain.comgrafana.yourdomain.comnas.yourdomain.comkvm.yourdomain.commonitoring.yourdomain.comspeedtest.yourdomain.comsync.yourdomain.comtracker.yourdomain.com# NAS_backendcloud.yourdomain.comdav.yourdomain.com
I got this errorQuote[WARNING] (20353) : Proxy '1_HTTP_frontend': L6 sample fetches ignored on HTTP proxies (declared at /usr/local/etc/haproxy.conf.staging:70).Warnings were found.Configuration file is validWhat is wrong?
[WARNING] (20353) : Proxy '1_HTTP_frontend': L6 sample fetches ignored on HTTP proxies (declared at /usr/local/etc/haproxy.conf.staging:70).Warnings were found.Configuration file is valid
Quote from: Morta on February 12, 2022, 09:13:03 pmI got this errorQuote[WARNING] (20353) : Proxy '1_HTTP_frontend': L6 sample fetches ignored on HTTP proxies (declared at /usr/local/etc/haproxy.conf.staging:70).Warnings were found.Configuration file is validWhat is wrong?https://forum.opnsense.org/index.php?topic=27065.msg131206#msg131206
I have http webui with port 4444 impossible that listen on 80
I have just tried TCP mode with map file, there is a few more steps to achieve the goal instead of placing the map rule directly to 0_SNI(I checked the package and found SNI inside, however, haproxy doesn't recognize it in TCP mode, that's why we need to force it to recognize SNI)
Just take a look at the config file, I feel strange for some part of it1. You don't need to type WAN IP in 0_SNI_frontendinstead, it should be 0.0.0.0:80 and 0.0.0.0:4430.0.0.0 means any IP that points to your router.2. What is your router IP?If your router is 192.168.1.1, then 1_HTTP_frontend and 1_HTTPS_frontend will obviously conflict with 0_SNI_frontedSince 0_SNI_fronted is already listening to 80 and 443 port of your router, you won't able to listen it with 192.168.1.1Please follow Part 4-2 to create Virtual IP, and set 1_HTTP_frontend and 1_HTTPS_frontend to the virtual IPIf you don't want to create any Virtual IP, please remove 0_SNI_frontendset 1_HTTP_frontend with 0.0.0.0:80 and 1_HTTPS_frontend 0.0.0.0:443 insteadSince all of your servers are running in http mode, it should work for having no SNI frontend
Sure, just add it to your tutorial if you like.I have 2 TCP servers running. OpenVPN and v2ray(both of them have SNI header with it)I'm sure not all of the TCP services can use haproxy, for example minecraft server without additional tools.(One of the ways is to add one more rule to redirect other SSL connections to SSL_backend, and set minecraft server as default backend of 0_SNI, as no conditions or rules in haproxy can catch connections that doesn't have SNI header).