首页 >> 学识问答 >

如何解决http 403禁止访问?

2022-10-01 21:23:16 来源: 用户: 

您好,现在瑶瑶来为大家解答以上的问题。如何解决http 403禁止访问?相信很多小伙伴还不知道,现在让我们一起来看看吧!

1、通常显示403我立马都会想到路径配置不对,但我仔细看了一下,目录路径没问题:nginx.conf:复制代码代码如下:server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root /root/html; index index.html index.htm; }}系统中的路径查询结果:复制代码代码如下:[root@lizhong html]# ll /root/html/总用量 4-rw-r--r-- 1 root root 3 4月 18 11:07 index.html目录时存在。

2、重启nginx还是这个错误,后来想到是不是权限问题?于是在nginx.conf头部加入一行:复制代码代码如下:user root;重启nginx再访问,就可以正常访问了。

本文就为大家分享到这里,希望小伙伴们会喜欢。

  免责声明:本文由用户上传,与本网站立场无关。财经信息仅供读者参考,并不构成投资建议。投资者据此操作,风险自担。 如有侵权请联系删除!

 
分享:
最新文章