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测试本地

测试网页

相关推荐
●VON1 小时前
AtomGit Flutter鸿蒙客户端:文件树与代码浏览
android·服务器·安全·flutter·harmonyos·鸿蒙
bush48 小时前
嵌入式linux学习记录七,中断
linux·嵌入式
RisunJan8 小时前
Linux命令-nologin(用于系统账户或需要禁止交互式登录的场景)
linux·运维
是阿建吖!8 小时前
【Linux】信号
android·linux·c语言·c++
城北徐宫8 小时前
Linux信号深度解剖:5种产生、3张表、4次切换
linux·c++·学习
倔强的石头1068 小时前
【Linux指南】Linux快捷键与系统实用技巧
linux·运维·服务器
番茄地瓜8 小时前
Linux 配置静态 IP 步骤
linux·运维·服务器
liulilittle8 小时前
论 Linux 内核态全局稳态带宽的卡尔曼估计与工程实现
linux·服务器·网络·c++·计算机网络·tcp·通信
Irissgwe9 小时前
五、应用层协议HTTP
linux·网络·网络协议·http·状态码·url
.千余9 小时前
【Linux】 传输层协议UDP:从端口号到传输机制
linux·运维·udp