2012-06-13 31 views
3

我使用supervisord管理龍捲風而沒有使用nginx作爲負載均衡器的問題。主管和uWSGI將不會與nginx一起工作

我與監督員和uWSGI與nginx作爲負載blancer嚴重問題。我使用瓶子作爲框架。

當我從命令行運行下面的代碼時,我加載了一個FF打到nginx的頁面,所有的工作都很好。

sudo command = /usr/local/bin/uwsgi --loop gevent --socket 127.0.0.1:8070 --wsgi-file /home/ubuntu/workspace/uwsgiServer.py -b 32768 --master --async 5 --enable-threads --listen 100 --uid root 

如果我把命令行放在supervior中,那麼我找不到頁面。

uWSGI Error 
Python application not found 



[program:uwsgi] 
#autostart=true 
#autorestart=true 
#process_name = uwsgi-%(process_num)s 
command = /usr/local/bin/uwsgi --loop gevent --socket 127.0.0.1:8070 --wsgi-file /home/ubuntu/workspace//uwsgiServer.py -b 32768 --master --async 5 --enable-threads --listen 100 --uid root 
#--port=%(process_num)s 
#--log_file_prefix=%(here)s/logs/%(program_name)s-%(process_num)s.log 
#numprocs = 1 
#numprocs_start = 8070 

這裏是nginx.conf文件的相關部分:

upstream uwsgi_b { 
     server 127.0.0.1:8070; 
    } 


location /u/ { 
         include uwsgi_params; 
         uwsgi_param X-Real-IP $remote_addr; 
         uwsgi_param Host $http_host; 
         uwsgi_pass uwsgi_b; 
       } 

回答

5

你可能會添加一些更PARAMS到supervisord配置,像--pp(蟒蛇路徑)的uwsgi命令,也許一些環境變量:

[program:uwsgi] 
command = /usr/local/bin/uwsgi 
    --loop gevent 
    --socket 127.0.0.1:8070 
    --wsgi-file uwsgiServer.py 
    --buffer-size 32768 --master --async 5 --enable-threads --listen 100 --uid root 
    --pp /home/ubuntu/workspace/ 

autostart=true 
autorestart=true 
environment=ENV_VAR='var' 
user=root # or other 
group=root # or other 
directory=/home/ubuntu/workspace/ 
umask=022 

編輯:刪除特定的Django設置

+0

嗨,它不是一個django應用程序。沒有靜態目錄。 – Tampa

+0

Ops,對不起,只是看着我的一個配置。你有沒有嘗試在命令中加入--pp? – Tisho

+0

或設置目錄= /路徑。這似乎是一個失蹤的路徑問題... – Tisho