系统相关
首页 > 系统相关> > dss nginx 403 forbidden

dss nginx 403 forbidden

作者:互联网

在centos7上面搭建 DataSphereStudio 精简版, 一切安装成功之后, 发现访问 ip:8088 一直显示 403 forbidden, 一直以为是软件装的不对, 追个排查之后才发现是 nginx的问题,nginx的 配置他没写, 我们使用的是默认配置, 默认配置下 nginx 的程序用户是nginx用户, nginx 用户没有权限访问dss 的web资源.

nginx 报错日志:

2020/12/16 14:26:02 [error] 5951#0: *1 "/home/bank/dss/dss_linkis/web/dist/index.html" is forbidden (13: Permission denied), client: 10.0.8.8, server: localhost, request: "GET / HTTP/1.1", host: "10.10.10.62:8089"
2020/12/16 14:26:02 [error] 5951#0: *1 open() "/home/bank/dss/dss_linkis/web/dist/favicon.ico" failed (13: Permission denied), client: 10.0.8.8, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "10.10.10.62:8089", referrer: "http://10.10.10.62:8089/"
2020/12/16 14:26:53 [error] 5951#0: *1 "/home/bank/dss/dss_linkis/web/dist/index.html" is forbidden (13: Permission denied), client: 10.0.8.8, server: localhost, request: "GET / HTTP/1.1", host: "10.10.10.62:8089"
2020/12/16 14:26:54 [error] 5951#0: *1 open() "/home/bank/dss/dss_linkis/web/dist/favicon.ico" failed (13: Permission denied), client: 10.0.8.8, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "10.10.10.62:8089", referrer: "http://10.10.10.62:8089/"
2020/12/16 14:31:14 [error] 5951#0: *3 "/home/bank/dss/dss_linkis/web/dist/index.html" is forbidden (13: Permission denied), client: 10.0.8.8, server: localhost, request: "GET / HTTP/1.1", host: "10.10.10.62:8089"
2020/12/16 14:31:14 [error] 5951#0: *3 open() "/home/bank/dss/dss_linkis/web/dist/favicon.ico" failed (13: Permission denied), client: 10.0.8.8, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "10.10.10.62:8089", referrer: "http://10.10.10.62:8089/"
2020/12/16 14:31:14 [error] 5951#0: *3 "/home/bank/dss/dss_linkis/web/dist/index.html" is forbidden (13: Permission denied), client: 10.0.8.8, server: localhost, request: "GET / HTTP/1.1", host: "10.10.10.62:8089"

具体解决方法如下:
这里参考的是 添加链接描述
上面的日志中“Permission denied”,一看就知道是权限出了问题,通过 ps -ef | grep nginx,查看 nginx 的进程信息:


root     15889     1  0 00:01 ?        00:00:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
nginx   15890 15889  0 00:01 ?        00:00:00 nginx: worker process
root     16795 15654  0 00:48 pts/3    00:00:00 grep --color=auto nginx

发现 nginx 进程的用户是 nginx,而我们创建 /root/nginx/html/daolian/favicon.ico 文件的用户是root;因此,只要把 nginx 的进程 user 改为 root 即可,vim /etc/nginx/nginx.conf:

user root;
之后,/etc/init.d/nginx restart 重启 nginx,就可以正常访问网站了。

标签:00,14,forbidden,dss,nginx,403,10.10,10.62
来源: https://blog.csdn.net/Apache_Jerry/article/details/111273929