## 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 1 hard-stop-after 60s maxconn 10 tune.ssl.default-dh-param 2048 spread-checks 2 tune.chksize 16384 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 (listening on 0.0.0.0:80, 0.0.0.0:443, 0.0.0.0:853)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 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 req.ssl_ver gt 0 # 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 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_1 192.168.5.152:8053
acl is_websocket hdr(Upgrade) -i WebSocketacl is_websocket hdr_beg(Host) -i wsuse_backend <myBackend(Pool)> if is_websocket
[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
First of all thank you for the Guide it was great and helped me out a lot. I just have a question as I have to use a vpn adapter call for work called Zscaler and it try to make a tunnel using port 443. How do i tell HAproxy as a default to only route only thing in the map file and dont intercept anything else. So the vpn client can create a tunnel.
tcp-request inspect-delay 5suse_backend OPENVPN_backend if req_ssl_hello_type 1tcp-request content accept if !{ req_ssl_hello_type 1 }
I have two Server with several vhosts behind a OPNsense Router/FirewallIs this also possible to have two server which need certs? Or only one?When if it’s possible, how I have to do it?
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?
<VirtualHost *:80> ServerAdmin mail@xxx.com ServerName xxx.ch ServerAlias www.xxxx.ch DocumentRoot /usr/share/webapps/blog/ DirectoryIndex index.php RemoteIPProxyProtocol On <Directory /usr/share/webapps/blog> Options +Indexes +FollowSymLinks +MultiViews AllowOverride All Order allow,deny allow from all <FilesMatch \.php$> # For Apache version 2.4.10 and above, use SetHandler to run PHP as a fastCGI process server SetHandler "proxy:unix:/run/php-fpm/php-fpm.sock|fcgi://localhost" </FilesMatch> <Files "*.php"> MultiviewsMatch Any </Files> </Directory> ErrorLog /var/log/httpd/blog_error.log CustomLog /var/log/httpd/blog_access.log combined</VirtualHost>
## 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 0.0.0.0:80 0.0.0.0:443)frontend O_SNI_fronted bind 0.0.0.0:80 name 0.0.0.0:80 bind 0.0.0.0:443 name 0.0.0.0:443 mode tcp default_backend SSL_backend # tuning options timeout client 30s # logging options# Frontend: 1_HTTP_frontend (Listening 127.0.0.1:80)frontend 1_HTTP_frontend bind 127.0.0.1:80 name 127.0.0.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 127.0.0.1:443)frontend 1_HTTPS_frontend http-response set-header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" bind 127.0.0.1:443 name 127.0.0.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:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256 ciphersuites TLS_AES_128_GCM_SHA256: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 127.0.0.1 send-proxy-v2 check-send-proxy# Backend: 5erver_backend (Server backend)backend 5erver_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 # ERROR: server data not found (0b989d9b-eb50-4dff-8a2f-6bc56245fd74)# Backend: NAS_backend (NAS backend)backend 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 # ERROR: server data not found (36c63574-bd94-43f7-836e-cd78c8edc6c0)
#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
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.