我正在配置Django项目与Nginx和Gunicorn一起使用。
当我在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"
以下是我的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;
}
}
我的 HTML 页面显示 502 Bad Gateway
错误。
我做错了什么?
policycoreutils-python
才能获得audit2allow
。参考链接:https://www.centos.org/forums/viewtopic.php?t=5012 - gross.jonaspolicycoreutils-python
并没有提供audit2allow
命令。经过一些研究,我发现你应该安装 devel 包yum install policycoreutils-devel
。参考:http://danwalsh.livejournal.com/61710.html - Joseph N.