http——配置nginx服务通过ip访问多网站

关防火墙

systemctl stop firewalld

setenforce 0

安装挂载web

mount /dev/sr0 /mnt

dnf install nginx -y

启动web

systemctl start nginx

nmcli配置网卡

nmcli connection modify ens160 ipv4.method manual ipv4.addresses 192.168.182.100/24 +ipv4.addresses 192.168.182.200/24 ipv4.gateway 192.168.182.2 ipv4.dns 8.8.8.8

激活配置

nmcli connection up ens160

xshell更新连接ip后创建子配置文件并定义多个server模块

vim /etc/nginx/conf.d/test_ip.conf

创建对应目录文件

mkdir /test/{100,200} -pv

mkdir: created directory '/test'

mkdir: created directory '/test/100'

mkdir: created directory '/test/200'

echo test 100 > /test/100/index.html

echo test 200 > /test/200/index.html

重启服务

systemctl restart nginx

curl测试本地

测试网页

相关推荐
A゛孤青4 分钟前
VMware磁盘清理,解决空间占用不断增大的问题
linux·运维
不染尘.10 分钟前
Linux磁盘分区和NAT网络配置
linux·运维·网络·windows·ssh
model200511 分钟前
alibaba linux3 定时下载任务未执行
linux·运维·服务器
nie_xl23 分钟前
VS/TRAE中设置本地maven地址的方法
运维·服务器·前端
yuanmenghao30 分钟前
车载Linux 系统问题定位方法论与实战系列 - 开篇: 为什么需要一套“系统化”的 Linux 问题定位方法
linux·运维·服务器·数据结构·c++·自动驾驶
岁岁种桃花儿31 分钟前
深入理解 Keepalive:从协议到 Nginx 实战(全场景解析)
运维·nginx
CheungChunChiu32 分钟前
# Xorg 配置与 modesetting 驱动详解:从设备节点到显示旋转
android·linux·ubuntu·显示·xserver
柏木乃一32 分钟前
基础IO(上)
linux·服务器·c语言·c++·shell
康小庄35 分钟前
通过NGINX实现将小程序HTTPS请求转为内部HTTP请求
java·spring boot·nginx·spring·http·小程序
DeeplyMind36 分钟前
第7章:DRM内核调试技术:7.1 DRM DebugFS的使用
linux·驱动开发·drm·debugfs·drm debugfs