多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)

相关推荐
君穆南5 小时前
基于 NFS 与 Rsync 实现跨服务器 Seafile 数据平滑迁移实战
linux·运维·git
bloglin999995 小时前
scp、rsync远程文件同步
linux·运维·服务器
迦南的迦 亚索的索5 小时前
LINUX环境
linux·运维·服务器
yuanjj885 小时前
linux下调试域格CLM920 NC5等9x07平台模块 QMI拨号
linux·运维·服务器
IMPYLH6 小时前
Linux 的 printenv 命令
linux·运维·服务器·bash
SilentSamsara6 小时前
SSH 远程管理:密钥登录 + 隧道转发,一次性配置好
linux·运维·服务器·ubuntu·centos·ssh
LN花开富贵6 小时前
【ROS】鱼香ROS2学习笔记一
linux·笔记·python·学习·嵌入式·ros·agv
疏星浅月6 小时前
数据对齐的底层原理与性能优化
linux
Jurio.6 小时前
本机开发 + 多机执行的极简远端运行工具
linux·git·python·github·远程工作
2501_945837437 小时前
OpenClaw:开启 “行动 AI“ 新纪元,从聊天机器人到自主智能体的范式革命
服务器