10.0.0.150 ha1
10.0.0.170 web1
10.0.0.180 web2
10.0.0.190 client
[root@ha1 ~]
[root@ha1 ~]
listen httpd_80
bind 0.0.0.0:80
mode tcp
server web1 10.0.0.170:80 send-proxy weight 1 check inter 2000 rise 2 fail 3
server web2 10.0.0.180:80 send-proxy weight 2 check
listen stats
mode http
bind 10.0.0.150:9999
stats enable
log global
stats uri /haproxy-status
stats auth haadmin:123456
[root@web1 ~]
[root@web1 ~]
...
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" "$proxy_protocol_addr"';
access_log /var/log/nginx/access.log main;
server {
listen 80 proxy_protocol default_server;
...
}
...
[root@web1 ~]
[root@web1 ~]
[root@web1 ~]
web1.tan.com
[root@web2 ~]
[root@web2 ~]
...
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" "$proxy_protocol_addr"';
access_log /var/log/nginx/access.log main;
server {
listen 80 proxy_protocol default_server;
...
}
...
[root@web2 ~]
[root@web2 ~]
[root@web2 ~]
web2.tan.com
[root@client ~]
web2.tan.com
[root@client ~]
web1.tan.com
[root@client ~]
web2.tan.com
[root@client ~]
web2.tan.com
[root@client ~]
web1.tan.com
[root@web1 ~]
::1 - - [27/Aug/2022:08:55:46 +0800] "GET / HTTP/1.1" 200 13 "-" "curl/7.61.1" "-"
10.0.0.150 - - [27/Aug/2022:09:06:31 +0800] "GET / HTTP/1.1" "10.0.0.190"
10.0.0.150 - - [27/Aug/2022:09:06:43 +0800] "GET / HTTP/1.1" "10.0.0.190"
[root@web2 ~]
::1 - - [27/Aug/2022:09:00:19 +0800] "GET / HTTP/1.1" 200 13 "-" "curl/7.61.1" "-"
10.0.0.150 - - [27/Aug/2022:09:06:29 +0800] "GET / HTTP/1.1" "10.0.0.190"
10.0.0.150 - - [27/Aug/2022:09:06:33 +0800] "GET / HTTP/1.1" "10.0.0.190"
10.0.0.150 - - [27/Aug/2022:09:06:34 +0800] "GET / HTTP/1.1" "10.0.0.190"
[root@client ~]
curl: (52) Empty reply from server
[root@client ~]
curl: (52) Empty reply from server
[root@ha1 ~]
...
mode http
...
[root@ha1 ~]
[root@web1 ~]
...
log_format main '$remote_addr - $remote_user [$time_local] "$request" "$proxy_add_x_forwarded_for" ';
...
[root@web1 ~]
[root@web2 ~]
...
log_format main '$remote_addr - $remote_user [$time_local] "$request" "$proxy_add_x_forwarded_for" ';
...
[root@web2 ~]
[root@client ~]
web1.tan.com
[root@client ~]
web2.tan.com
[root@client ~]
web2.tan.com
[root@client ~]
web1.tan.com
[root@client ~]
web2.tan.com
[root@client ~]
web2.tan.com
[root@client ~]
web1.tan.com
[root@client ~]
web2.tan.com
[root@web1 ~]
10.0.0.150 - - [27/Aug/2022:09:35:57 +0800] "GET / HTTP/1.1" "10.0.0.190, 10.0.0.150"
10.0.0.150 - - [27/Aug/2022:09:35:59 +0800] "GET / HTTP/1.1" "10.0.0.190, 10.0.0.150"
10.0.0.150 - - [27/Aug/2022:09:35:55 +0800] "GET / HTTP/1.1" "10.0.0.190, 10.0.0.150"
[root@web2 ~]
10.0.0.150 - - [27/Aug/2022:09:35:57 +0800] "GET / HTTP/1.1" "10.0.0.190, 10.0.0.150"
10.0.0.150 - - [27/Aug/2022:09:35:58 +0800] "GET / HTTP/1.1" "10.0.0.190, 10.0.0.150"
10.0.0.150 - - [27/Aug/2022:09:35:58 +0800] "GET / HTTP/1.1" "10.0.0.190, 10.0.0.150"
10.0.0.150 - - [27/Aug/2022:09:35:59 +0800] "GET / HTTP/1.1" "10.0.0.190, 10.0.0.150"
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· winform 绘制太阳,地球,月球 运作规律
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· AI 智能体引爆开源社区「GitHub 热点速览」
· 写一个简单的SQL生成工具