
1.如遇403错误,则在ngjnx.conf首行添加user root

2.在server中添加root为项目所在目录
/root/website/html/index.html
root /root/website/
index index.html index.htm;

3.开启nginx
systemctl start nginx
systemctl status nginx

4.cd /etc/nginx
vim nginx.conf
service nginx restart :重启nginx

5.url:139.155.17.27:81/html/
Centos中用Nginx部署静态页面
最新推荐文章于 2024-07-27 10:30:32 发布
本文介绍了解决Nginx服务器403错误的方法,包括在配置文件中添加用户根目录、设置正确的静态资源路径、重启Nginx服务等步骤。适用于网站部署时遇到权限问题的情况。
2975

被折叠的 条评论
为什么被折叠?



