(13:权限被拒绝)连接到上游时:[nginx] - (13: Permission denied) while connecting to upstream:[nginx]
问题:
I am working with configuring Django project with Nginx and Gunicorn.我正在使用 Nginx 和 Gunicorn 配置 Django 项目。
While I am accessing my port gunicorn mysite.wsgi:application --bind=127.0.0.1:8001
in Nginx server, I am getting the following error in my error log file;当我在 Nginx 服务器中访问我的端口gunicorn mysite.wsgi:application --bind=127.0.0.1:8001
时,我在错误日志文件中收到以下错误;
2014/05/30 11:59:42 [crit] 4075#0: *6 connect() to 127.0.0.1:8001 failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream:
"http://127.0.0.1:8001/"
, host: "localhost:8080" 2014/05/30 11:59:42 [crit] 4075#0: *6 connect() to 127.0.0.1:8001 连接到上游时失败(13:权限被拒绝),客户端:127.0.0.1,服务器:本地主机,请求:“GET / HTTP/1.1”,上游:"http://127.0.0.1:8001/"
,主机:“localhost:8080”
Below is the content of my nginx.conf
file;下面是我的nginx.conf
文件的内容;
server {
listen 8080;
server_name localhost;
access_log /var/log/nginx/example.log;
error_log /var/log/nginx/example.error.log;
location / {
proxy_pass http://127.0.0.1:8001;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
}
}
In the HTML page I am getting 502 Bad Gateway
.在 HTML 页面中,我收到502 Bad Gateway
。
What mistake am I doing?我在做什么错误?
解决方案:
参考一: http://stackoom.com/question/1cU6Z参考二: (13: Permission denied) while connecting to upstream:[nginx]
- 用 JavaScript 计算昨天的日期 - Calculate the date yesterday in JavaScript
- 允许保留 2 位小数 - Allow 2 decimal places in
- 在 Android 上防止屏幕旋转 - Prevent screen rotation on Android
- 如何更新 RecyclerView 适配器数据 - How to update RecyclerView Adapter Data
- 日历重复/重复事件 - 最佳存储方法 - Calendar Recurring/Repeating Events - Best Storage Method
- (13:权限被拒绝)连接到上游时:[nginx] - (13: Permission denied) while connecting to upstream:[nginx]
- 如何使用 git 检查 GitHub 拉取请求? - How can I check out a GitHub pull request with git?
- 正则表达式:删除包含“帮助”等的行 - Regex: Remove lines containing “help”, etc
- >>>和>>之间的区别 - Difference between >>> and >>
- JavaScript 中反引号 (`) 的用法 - Usage of the backtick character (`) in JavaScript
- C 模板typedef - C template typedef
- 仅添加非空白更改 - Add only non-whitespace changes
- Python中exit()和sys.exit()之间的区别 - Difference between exit() and sys.exit() in Python
- Git:仅列出“未跟踪”的文件(还有自定义命令) - Git: list only “untracked” files (also, custom commands)
- 谷歌使用什么数据库? - What database does Google use?
- 在CLR中投放与使用'as'关键字 - Casting vs using the 'as' keyword in the CLR
- 值对的 Java 集合? (元组?) - A Java collection of value pairs? (tuples?)
- 'git 责备' 有什么作用? - What does 'git blame' do?
- 蚂蚁警告:“'includeantruntime'未设置” - ant warning: “'includeantruntime' was not set”
- 如何在不等待的情况下安全地调用 C# 中的异步方法 - How to safely call an async method in C# without await