nginx 代理静态网页
在 /etc/nginx/conf.d 目录中创建网页配置文件:
sudo vim /etc/nginx/conf.d/avincheng.conf插入配置:
# avincheng.com
server {
listen 80;
server_name avincheng.com;
root /home/wwwroot/avincheng.com;
index index.html;
}Tips:
listen为监听的端口,一般为 80。
server_name为绑定的域名,多个域名空格隔开,填写_则表示使用 IP 直接访问。
root为存放静态页面文件的目录,确保每一层目录权限至少为 755。
index为首页文件,确保文件权限至少为 644。
重启 nginx 服务:
sudo systemctl restart nginxLast updated
Was this helpful?