Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of Nginx 13: Permission denied

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to solve the problem of Nginx 13: Permission denied, the article is very detailed, has a certain reference value, interested friends must read it!

When you encounter a 502 error when deploying flask applications with uwsgi+nginx, vim / var/log/nginx/error.log looks at the error log of nginx and prompts the following error message:

00:46:36 on 2018-07-22 [crit] 1589015890: * 74 connect () to unix:/root/jianshuvue/jianshu.sock failed (13: Permission denied) while connecting to upstream, client: 120.42.13.98, server: jianshu.weiweiblog.cn, request: "GET / favicon.ico HTTP/1.1", upstream: "uwsgi://unix:/root/jianshuvue/jianshu.sock:", host: "jianshu.weiweiblog.cn", referrer: "http://jianshu.weiweiblog.cn/jianshu/67eb7ed414d3"

Permission denied, you can see that there is a problem with the permission. Use ps-ef | grep nginx to view the process information of nginx:

Root 15889 1 0 00:01? 00:00:00 nginx: master process / usr/sbin/nginx-g daemon on; master_process on

Www-data 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

It is found that the user of the nginx process is nginx, and the user we created the / root/jianshuvue/jianshu.sock file is root, so just change the process user of nginx to root, vim / etc/nginx/nginx.conf:

# user www-data;user root;worker_processes auto;pid / run/nginx.pid

After that, / etc/init.d/nginx restart restarts nginx, and you can visit the website normally.

The above is all the contents of the article "how to solve the problem of Nginx 13: Permission denied". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report