Nginx、Uwsgi、Django 问题

Nginx, Uwsgi, Django Issue

我正在尝试 运行 一个带有 nginx 和 uwsgi 的 django 站点。所有配置对我来说似乎都是正确的,uwsgi 和 nginx 没有显示任何错误。但该网站仍未加载。似乎 nginx 根本没有读取 conf 文件。这里有更多的细节 项目目录:

/var/www/myproject/
/var/www/myproject/myapp
/var/www/myproject/myproject/settings.py
/var/www/myproject/myproject/wsgi.py

Nginx 会议:

upstream django {
 server 127.0.0.1:8001;}
server {   
listen      8181;
server_name 0.my.ip.0
charset     utf-8;
client_max_body_size 75M;
location /media  {
alias /var/www/myproject/media;
}
location /static {
    alias /var/www/myproject/static;
}
location / {
    uwsgi_pass  django;
    include     uwsgi_params;
}}

UWSGI:

[uwsgi]
chdir           = /var/www/myproject/
module          = myproject.wsgi:application
master          = true
processes       = 5
max-requests    =5000
socket          = 127.0.0.1:8001
chmod-socket    = 664
vacuum          = true
daemonize=/my/log/file.log

我是这样开始uwsgi的

sudo uwsgi --emperor /etc/uwsgi/vassals --uid www-data --gid www-data

这是输出:

*** Starting uWSGI 2.0.11.1 (64bit) on [Sat Aug 15 12:51:58 2015] ***
compiled with version: 4.8.4 on 15 August 2015 03:50:24
os: Linux-3.13.0-48-generic #80-Ubuntu SMP Thu Mar 12 11:16:15 UTC 2015
nodename: ip-172-31-27-238
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 1
current working directory: /var/www/myproject
detected binary path: /usr/local/bin/uwsgi
setgid() to 33
setuid() to 33
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 7862
your memory page size is 4096 bytes
detected max file descriptor number: 1024
*** starting uWSGI Emperor ***
*** has_emperor mode detected (fd: 6) ***
[uWSGI] getting INI configuration from myproject.ini
Sat Aug 15 12:51:59 2015 - [emperor] vassal myproject.ini has been spawned
Sat Aug 15 12:51:59 2015 - [emperor] vassal myproject.ini is ready to accept         requests

我的 uwsgi conf 文件在 /etc/uwsgi/vassals 中有符号链接,而 nginx conf 在 /etc/nginx/sites-enabled 中有符号链接,其中有一个 default 文件提供欢迎页面,但我也删除了它。在我可以用来调试的 nginx access.log 和 error.log 中没有任何显示,当我打开 myip:8181 时在浏览器中没有任何显示。

请查看 conf,让我知道可能是什么问题或如何调试它。

编辑: 以上设置正确,问题是我尝试的端口被阻止:(

确保没有防火墙阻止8181端口访问。

另外确保8181端口被nginx服务监听

netstat -ntpua|grep 8181