vi /etc/nginx/nginx.conf
server {
listen 80; #監(jiān)聽(tīng)端口
server_name xxx.xxx.site; #站點(diǎn)域名
location / {
root /var/www/xxx; # 站點(diǎn)根目錄
index index.html index.htm index.py; #默認(rèn)首頁(yè)文件
}
}
server是放http{}里的,不然會(huì)報(bào)錯(cuò) "server" directive is not allowed here in /etc/nginx/nginx.conf:
然后
nginx -s reload
成功頁(yè)面.png
嘿嘿嘿,夸寄幾一波