yum安装的nginx 的话
[root@localhost ~]# cd /etc/nginx/conf.d/
[root@localhost conf.d]# ll
总用量 8
-rw-r--r-- 1 root root 1072 4月 12 2023 default.conf.bak
-rw-r--r-- 1 root root 454 12月 9 10:54 upstream.conf
[root@localhost conf.d]#vim upstream.conf
upstream testweb {
server 192.168.128.166:80;
server 192.168.128.199:8080;
}
server {
listen 80;
server_name localhost;
charset utf-8;
#access_log logs/host.access.log main;
location / {
proxy_pass http://testweb;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
另外两台代理服务器我安装的是tomcat和php