@LB01(192.168.99.121)
1.安装Nginx,配置反向代理
yum install nginx
[root@lb01 nginx]# cat /etc/nginx/nginx.conf
upstream nodes {
server 192.168.99.201;
}
server {
location / {
proxy_pass http://nodes;
include proxy_params;
}
}
2.添加参数文件
[root@lb01 nginx]# cat /etc/nginx/proxy_params
proxy_redirect default;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
3.启动服务
systemctl enable --now nginx
firewall-cmd --add-service=http
firewall-cmd --add-service=http --per
setsebool -P httpd_can_network_connect on