多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 分钟前
【网络编程】套接字入门:网络字节序与套接字种类剖析
linux·网络·php·套接字
云计算练习生5 分钟前
Linux 操作系统防火墙工具Firewalld常用操作
服务器·网络·网络安全·防火墙·firewalld·linux操作系统
nbsaas-boot6 分钟前
使用 DuckDB 构建高性能 OLAP 分析平台
java·服务器·数据库
欢喜躲在眉梢里6 分钟前
mysql之二进制日志
运维·数据库·mysql·日志·数据·mysql日志
丬氼乀A10 分钟前
io的异步处理io_uring,实现io_uring_tcp_server
运维·服务器
tingting011921 分钟前
k8s kubelet 10250监控端口访问配置
linux·kubernetes·kubelet
失因44 分钟前
Nginx 反向代理、负载均衡与 Keepalived 高可用
运维·nginx·负载均衡
迎風吹頭髮1 小时前
UNIX下C语言编程与实践6-Make 工具与 Makefile 编写:从基础语法到复杂项目构建实战
运维·c语言·unix
码界奇点2 小时前
Nginx 502 Bad Gateway从 upstream 日志到 FastCGI 超时深度复盘
运维·nginx·阿里云·性能优化·gateway
struggle20252 小时前
Lightpanda:专为 AI 和自动化设计的无头浏览器
运维·人工智能·自动化