企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# nginx反向代理监控虚拟IP地址 [toc] ## 一、 编写nginx反向代理配置 ```sh server { listen 10.0.0.3:80; server_name www.etiantian.org; root html; index index.html index.htm; location / { proxy_pass http://noah; proxy_set_header host $host; proxy_set_header X-Forwarded-For $remote_addr; } } server { listen 10.0.0.3:80; server_name bbs.etiantian.org; root html; index index.html index.htm; location / { proxy_pass http://noah; proxy_set_header host $host; proxy_set_header X-Forwarded-For $remote_addr; } } ``` ## 二、 监听本地网卡上没有的IP地址 ```sh echo 'net.ipv4.ip_nonlocal_bind = 1' >>/etc/sysctl.conf #此操作我的模板机已进行优化,但不保证其他机器也会优化,所以写上 sysctl -p ``` ## 三、 重启服务 ```sh [root@xxx~]# nginx -s stop [root@xxx~]# nginx [root@xxx~]# netstat -lntup|grep nginx tcp 0 0 10.0.0.3:80 0.0.0.0:* LISTEN 53334/nginx ```