文章目录
- 第一种方法
- 第二种方法
先关闭防火墙
# systemctl stop firewalld
# setenforce 0
第一种方法
#mntui
第二种方法
# vim /etc/nginx/conf.d/test_ip.conf
# cat /etc/nginx/conf.d/test_ip.conf
server {
listen 192.168.234.100:80;
#server_name
root /test/100;
location / {
index index.html;
}
}
server {
listen 192.168.234.200:80;
#server_name
root /test/200;
location / {
index index.html;
}
}
# mkdir /test/{100,200} -pv
# echo this is 100 > /test/100/index.html
# echo this is 100 > /test/200/index.html
# systemctl restart nginx