詳解Nginx 13: Permission denied 解決方案
這篇文章主要介紹了詳解Nginx 13: Permission denied 解決方案,小編覺得挺不錯的,現在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
今天在用uwsgi+nginx在部署flask應用時,遇到502的錯誤,vim /var/log/nginx/error.log檢視nginx的錯誤日誌,提示如下錯誤資訊:
2018/07/22 00:46:36 [crit] 15890#15890: *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,一看就知道是許可權出了問題,透過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;
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
發現nginx程式的使用者是nginx,而我們建立/root/jianshuvue/jianshu.sock檔案的使用者是root,因此,只要把nginx的程式user改為root即可,vim /etc/nginx/nginx.conf:
user www-data;user root;worker_processes auto;pid /run/nginx.pid;
之後,/etc/init.d/nginx restart重啟nginx,就可以正常訪問網站了。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69911024/viewspace-2637610/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Python報錯:PermissionError: [Errno 13] Permission denied解決方案PythonError
- PermissionError: [Errno 13] Permission denied解決辦法Error
- Nginx: stat() failed (13: permission denied)NginxAI
- nginx部署(13:Permission denied)報錯Nginx
- PermissionError: [Errno 13] Permission denied: 'C:\\Users\\jason\\Documents\\t2'的解決方案Error
- Permission Denied(publickey) 解決
- PermissionError: [Errno 13] Permission denied 如何解決Error
- PermissionError: [Errno 13] Permission denied:的許可權該怎麼解決。。。Error
- 解決“su: cannot open session: Permission denied”Session
- 解決方案 git@github.com出現Permission denied (publickey)Github
- openSSH升級公鑰失效Permission denied (publickey)解決方案
- 解決centos 刪除資料夾 permission deniedCentOS
- git出現Permission denied的解決辦法Git
- 寶塔解決 mkdir() Permission Denied 的問題
- Nginx 日誌 failed (13: Permission denied) 錯誤(13:許可權被拒絕)NginxAI
- 成功解決PermissionError: [Errno 13] Permission denied: './data\\mnist\\train-images-idx3-ubyte'ErrorAI
- IOError: [Errno 13] Permission denied 解決:linux下python安裝並使用非root模組ErrorLinuxPython
- nginx之 [error] 6702#0:XXX is forbidden (13: Permission denied)NginxErrorORB
- mac vscode 更新失敗:Permission denied解決辦法MacVSCode
- Nginx報錯:Permission denied,沒有許可權!Nginx
- Python 執行報錯 PermissionError: [Errno 13] Permission denied: '***.***'PythonError
- 建立raw device tablespace報Linux Error: 13: Permission denieddevLinuxError
- oracle程式命令的6571(Linux Error: 13: Permission denied)OracleLinuxError
- FATAL: Failed to make swap directory /etc/squid/cache: (13) Permission deniedAIUI
- You do not have permission to get URL ‘/’ from this server解決方案Server
- Nginx日誌分析解決方案Nginx
- PermissionError: [Errno 13] Permission denied: 'C:\\Users\\hao\\Desktop\\test.xlsx'Error
- 高併發解決方案詳解(9大常見解決方案)
- 使用wireshark出現Couldn't run /usr/bin/dumpcap in child process: Permission denied解決辦法PCA
- Hexo deploy git permission deniedHexoGit
- 快取穿透詳解及解決方案快取穿透
- nginx 詳解Nginx
- Nginx詳解Nginx
- Nginx跨域的問題解決方案Nginx跨域
- nginx /Java 解決跨域問題方案NginxJava跨域
- 詳解摩杜雲“雲遊戲解決方案”遊戲
- [詳解] VMware vCloud雲解決方案有些啥?Cloud
- SSH 連線慢的解決方案詳解