首先要开启本地被监听的端口
代理访问查看防火墙状态
systemctl status firewalld
查看指定端口的状态
firewall-cmd --query-port=666/tcp
开启指定端口 要生效还要reload才会生效
firewall-cmd --add-port=123/tcp --permanent
firewall-cmd --reload
移除指定的端口
firewall-cmd --permanent --remove-port=123/tcp
server {
# 监听的端口号,也就是客户端访问的端口号
listen 9001;
# 监听的ip地址
server_name localhost;
# 正则表达式,当请求的url中带有/hosp 时 帮忙转发数据
# eg: localhost:9001/admin/hosp... 就会自动转发到70.16.47.444:8201/admin/hosp
location ~ /hosp/ {
proxy_pass http://70.16.47.224:8201;
}
location ~ /cmn/ {
proxy_pass http://70.26.47.235:8202;
}
}



