多IP访问多网站

root@server \~\]# mount /dev/sr0 /mnt #挂载 \[root@server \~\]# dnf install nginx -y #安装 ![](https://i-blog.csdnimg.cn/direct/b9f6963745f149168baf6ba6a6f776ea.png) \[root@server nginx\]# systemctl stop firewalld #关闭防火墙 \[root@server nginx\]# systemctl restart nginx #重启 \[root@server nginx\]# setenforce 0 #关闭selinux \[root@server nginx\]# nmtui #写多IP ![](https://i-blog.csdnimg.cn/direct/b36cef15650d41e7ad837d9d82501a27.png) \[root@server nginx\]# nmcli connection up ens160 #重启nmtui ![](https://i-blog.csdnimg.cn/direct/cab044b17c9a47e2a18f1f7e222c0053.png) \[root@server nginx\]#vim /etc/nginx/conf.d/test_ip.conf #编辑 ![](https://i-blog.csdnimg.cn/direct/5861f282058b4ff081c8d5cee004f485.png) \[root@server nginx\]# mkdir /test/{100,129,200} -pv #创建文件 ![](https://i-blog.csdnimg.cn/direct/e86ca72222bf4b8fb9286e7357eb71d4.png) \[root@server nginx\]# echo this is 129 \> /test/129/index.html \[root@server nginx\]# echo this is 100 \> /test/100/index.html \[root@server nginx\]# echo this is 200 \> /test/200/index.html #根据配置在主机创建数据文件 \[root@server nginx\]# systemctl restart nginx #重启 验证结果 ![](https://i-blog.csdnimg.cn/direct/7e475e7c759a4d31b2280010e9875763.png)![](https://i-blog.csdnimg.cn/direct/eab1742c9e4e4cd68a1a715c13c53cc9.png)![](https://i-blog.csdnimg.cn/direct/3100257d698e440bba36fc2eb66287c7.png) ![](https://i-blog.csdnimg.cn/direct/1cb31ad6fbf048e085555e97a11f2e77.png)

相关推荐
conkl2 小时前
构建 P2P 网络与分布式下载系统:从底层原理到安装和功能实现
linux·运维·网络·分布式·网络协议·算法·p2p
求知若渴,虚心若愚。3 小时前
Error reading config file (/home/ansible.cfg): ‘ACTION_WARNINGS(default) = True
linux·前端·ansible
π大星星️4 小时前
Nginx 四层(stream)反向代理 + DNS 负载均衡
运维·nginx·负载均衡
beyoundout5 小时前
HAproxy
linux·运维·服务器
qq_218753317 小时前
服务器查日志太慢,试试grep组合拳
运维·服务器
Jie_178 小时前
【linux】高可用集群Keepalived
linux·运维·服务器
思绪漂移8 小时前
阿里云【免费试用】Elasticsearch 智能运维 AI 助手
运维·elasticsearch·阿里云
aiprtem8 小时前
LVGL + ESP-Brookesia 嵌入式模拟桌面应用开发
linux·c语言·物联网
21号 19 小时前
4.应用层自定义协议与序列化
运维·服务器·网络
xx.ii10 小时前
4.Linux 应用程序的安装和管理
linux·服务器·网络