2013-05-11 53 views
0

我想配置的nginx + uWSGI爲當地machine..but nginx的和uWSGI不相互交融的Django項目..如何配置nginx的和uWSGI的Django項目

我已經把nginx的配置/etc/nginx/sites-available/default這就是:

upstream django { 
    # connect to this socket 
    # server unix:///tmp/uwsgi.sock; # for a file socket 
    server 127.0.0.1:8001;  # for a web port socket 
    } 

server { 
    # the port your site will be served on 
    listen  4321; 
    # the domain name it will serve for 
    server_name localhost; # substitute your machine's IP address or FQDN 
    charset  utf-8; 

    #Max upload size 
    client_max_body_size 75M; # adjust to taste 


    # Finally, send all non-media requests to the Django server. 
    location/{ 
     uwsgi_pass django; 
     include  /etc/nginx/uwsgi_params; # or the uwsgi_params you installed manually 
     } 
    } 

然後我用這個命令來啓動uWSGI:

uwsgi --socket 127.0.0.1:8001 --chdir /home/vaibhav/TRAC/coupon-rest-api/couponRestApi/ --wsgi-file couponRestApi/wsgi.py --master --processes 4 --threads 2 --stats 127.0.0.1:9191 

uWSGI是工作,但nginx的+ uWSGI不..please告訴我,我做錯了這裏...

nginx的日誌:

2013/05/11 11:12:56 [warn] 6563#0: server name "http://localhost/" has suspicious symbols in /etc/nginx/sites-enabled/default:30 
2013/05/11 11:12:56 [emerg] 6563#0: unexpected "}" in /etc/nginx/sites-enabled/default:79 
2013/05/11 11:16:01 [emerg] 8352#0: unexpected "}" in /etc/nginx/sites-enabled/default:79 

我發現了錯誤nginx的congiguration但現在當我打開Django管理面板的佈局被扭曲......

回答

1

嘗試在/ usr /本地/lib/python2.7/sites-packages/django/