vim /usr/local/nginx/conf/nginx.conf
新增一个server节点:新增server节点;新增server节点;新增server节点。不是在原来的server节点里面添加代码
server {
listen 81;
server_name localhost;
access_log logs/test.log;
location / {
index index.html;
root html/test;
}
}
cd /
mkdir test
cd test
vim index.html
网页内容如下:
<h1>Hello Nginx!</h1>
/usr/local/nginx/sbin
/nginx -s reload
http://192.168.43.139:81