<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://www.gentoo-zh.org/extern.php?action=feed&amp;tid=616&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Gentoo中文社区 / haproxy端口复用]]></title>
		<link>https://www.gentoo-zh.org/viewtopic.php?id=616</link>
		<description><![CDATA[haproxy端口复用 最近发表的帖子。]]></description>
		<lastBuildDate>Sun, 11 Dec 2022 00:12:30 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[haproxy端口复用]]></title>
			<link>https://www.gentoo-zh.org/viewtopic.php?pid=659#p659</link>
			<description><![CDATA[<p>yum install haproxy -y</p><p>/usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg</p><br /><p>配置文件haproxy.cfg:</p><p>global<br />log&#160; &#160; &#160; &#160; &#160;127.0.0.1 local0<br />log&#160; &#160; &#160; &#160; &#160;127.0.0.1 local1 notice</p><p>chroot&#160; &#160; &#160; /var/lib/haproxy<br />pidfile&#160; &#160; &#160;/var/run/haproxy.pid<br />maxconn&#160; &#160; &#160;4000<br />user&#160; &#160; &#160; &#160; haproxy<br />group&#160; &#160; &#160; &#160;haproxy<br />daemon</p><p># turn on stats unix socket<br />stats socket /var/lib/haproxy/stats</p><p>defaults<br />mode&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; http<br />log&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;global<br />option&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; httplog<br />option&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; dontlognull<br />option http-server-close<br />option&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; redispatch<br />retries&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;3<br />timeout http-request&#160; &#160; 10s<br />timeout queue&#160; &#160; &#160; &#160; &#160; &#160;1m<br />timeout connect&#160; &#160; &#160; &#160; &#160;10s<br />timeout client&#160; &#160; &#160; &#160; &#160; 1m<br />timeout server&#160; &#160; &#160; &#160; &#160; 1m<br />timeout http-keep-alive 10s<br />timeout check&#160; &#160; &#160; &#160; &#160; &#160;10s<br />maxconn&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;3000</p><p>frontend main<br />mode tcp<br />bind *:8081<br />log global<br />option tcplog<br />log-format %ft\ %b/%s</p><p>tcp-request inspect-delay 3s<br />acl is_https req.payload(0,3) -m bin 160301<br />#GET POS(T) PUT DEL(ETE) OPT(IONS) HEA(D) CON(NECT) TRA(CE)<br />acl is_http req.payload(0,3) -m bin 474554 504f53 505554 44454c 4f5054 484541 434f4e 545241<br />#SSH<br />acl is_ssh req.payload(0,3) -m bin 535348<br />tcp-request content accept if is_http<br />tcp-request content accept if is_https<br />tcp-request content accept if is_ssh<br />tcp-request content accept<br />use_backend https if is_https<br />use_backend http if is_http<br />use_backend ssr if is_ssh<br />use_backend ssr</p><p>backend ssr<br />mode tcp<br />timeout server 1h<br />server server-ssh 127.0.0.1:61000</p><p>backend http<br />mode tcp<br />server ngx01 127.0.0.1:80 maxconn 10 check inter 3s</p><p>backend https<br />mode tcp<br />server ngx02 127.0.0.1:433 maxconn 10 check inter 3s</p>]]></description>
			<author><![CDATA[dummy@example.com (batsom)]]></author>
			<pubDate>Sun, 11 Dec 2022 00:12:30 +0000</pubDate>
			<guid>https://www.gentoo-zh.org/viewtopic.php?pid=659#p659</guid>
		</item>
	</channel>
</rss>
