[root@nginx ~]# cd /etc/nginx/conf.d/
[root@nginx conf.d]# mv default.conf{,.bak}
[root@nginx conf.d]# ls
default.conf.bak
[root@nginx conf.d]# vim test.conf
server {
listen 80;
server_name www.test-01.org;
root /code/test;
location / {
index index.html;
}
}
[root@nginx conf.d]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@nginx conf.d]# systemctl reload nginx.service
创建目录
[root@nginx conf.d]# mkdir -p /code/test
[root@nginx conf.d]# echo "<h1>test-01<h1>" >> /code/test/index.html
windows做域名劫持
浏览器访问测试