[补充]关于uwsgi_params:官网上面是这么说的:ConfigurenginxforyoursiteYouwillneedtheuwsgi_paramsfile,whichisavailableinthenginxdirectoryoftheuWSGIdistribution,orfromhttps://github.com/nginx/nginx/blob/master/conf/uwsgi_paramsCopyitintoyourprojectdirectory.Inamomentwewilltellnginxtorefertoit.[原文]按照这个文档http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html部署uwsgi+nginx+django的时候,uwsgi和django或纯python配合都能出正确结果,安装了nginx之后也能在浏览器刷新看到Welcometonginx!。然后我把nginx配置文件建立在django项目文件夹下面了:#mysite_nginx.conf#theupstreamcomponentnginxneedstoconnecttoupstreamdjango{#serverunix:///path/to/your/mysite/mysite.sock;#forafilesocketserver127.0.0.1:8001;#forawebportsocket(we'llusethisfirst)}#configurationoftheserverserver{#theportyoursitewillbeservedonlisten8000;#thedomainnameitwillserveforserver_name192.168.33.10;#substituteyourmachine'sIPaddressorFQDNcharsetutf-8;#maxuploadsizeclient_max_body_size75M;#adjusttotaste#Djangomedialocation/media{alias/home/vagrant/mysite/mysite/media;#yourDjangoproject'smediafiles-amendasrequired}location/static{alias/home/vagrant/mysite/mysite/static;#yourDjangoproject'sstaticfiles-amendasrequired}#Finally,sendallnon-mediarequeststotheDjangoserver.location/{uwsgi_passdjango;include/home/vagrant/mysite/mysite/uwsgi_params;#theuwsgi_paramsfileyouinstalled}}但无论是试图直接用test.py输出helloworld,还是启动django服务器,都仍然只能看到Welcometonginx!,服务器ip后面带上路径也是只有这个。直接用test.py的时候输出如下:$uwsgi--socket:8001--wsgi-filetest.py***StartinguWSGI2.0.9(64bit)on[MonFeb215:54:012015]***compiledwithversion:4.6.3on02February201509:51:05os:Linux-3.2.0-23-generic#36-UbuntuSMPTueApr1020:39:51UTC2012nodename:precise64machine:x86_64clocksource:unixdetectednumberofCPUcores:2currentworkingdirectory:/home/vagrant/mysite/mysitedetectedbinarypath:/home/vagrant/mysite/bin/uwsgi!!!nointernalroutingsupport,rebuildwithpcresupport!!!***WARNING:youarerunninguWSGIwithoutitsmasterprocessmanager***yourprocessesnumberlimitis2782yourmemorypagesizeis4096bytesdetectedmaxfiledescriptornumber:1024lockengine:pthreadrobustmutexesthunderlock:disabled(youcanenableitwith--thunder-lock)uwsgisocket0boundtoTCPaddress:8001fd3Pythonversion:2.7.3(default,Dec182014,19:25:50)[GCC4.6.3]***Pythonthreadssupportisdisabled.Youcanenableitwith--enable-threads***Pythonmaininterpreterinitializedat0x1579b10yourserversocketlistenbacklogislimitedto100connectionsyourmercyforgracefuloperationsonworkersis60secondsmapped72768bytes(71KB)for1cores***OperationalMODE:singleprocess***WSGIapp0(mountpoint='')readyin0secondsoninterpreter0x1579b10pid:1655(defaultapp)***uWSGIisrunninginmultipleinterpretermode***spawneduWSGIworker1(andtheonly)(pid:1655,cores:1)
添加回答
举报
0/150
提交
取消