[??] uwsgi_params ??:
?? ?????? ??? ?? ??? ?? ????.
??? ???? ?? nginx? ?????
uWSGI ???? nginx ???? ?? https://github.com/nginx/nginx/blob/master/conf/uwsgi_params
?? ??? ? ?? uwsgi_params ??? ?????. ?? ???? ????? ?????. ?? ? nginx? ?? ????? ???????.
[??]
? ?? http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html? ?? uwsgi+nginx+django? ??? ? uwsgi? django ?? ?? Python? ??? ??? ??? ??? ? ???, nginx
之后也能在瀏覽器刷新看到Welcome to nginx!
??????.
?? ?? django ???? ?? ??? nginx ?? ??? ??????.
?????? test.py? ?? ???? hello world? ????? ??? django ??? ????? ?? ??? Welcome to nginx!
? ? ? ??? ?? IP? ???? ??? ??? ?????.
test.py? ?? ???? ?? ??? ??? ????.
?????? ???????. ?? /etc/nginx/sites-enabled/
下面有兩個(gè)配置文件:default
和我自己配置的mysite_nginx.conf
, nginx??? ????? default? ???? ?????. ???? ???? ???.
?? ??? ???? ????. nginx ?? ??? ???? ???? ?????. ?? ?? ??? ??? ???? ?? ??? ????? ??????.
Nginx? ?? 8000?? ???? ???? nginx? 8000 ??? ????? ???.
??? nginx django ???
?????? django? ????? ?? 8001? ???? ?? ???.
uwsgi_params? nginx? ????. ?? ?? ?????. uwsgi_params? /etc/nginx/uwsgi_params
? ????.
.
????? ??? ????. ??, ? ???? ??? ?????? ?????. ?? ??? ??? nginx:8000 django:8001
???.
? ?? python Manage.py runserver localhost:8000? ??? ? ??? ???? ?? nginx ?? ??? ???? ??? ?????. ?? ?? 80? ???? ??? ? ????. ????? ??? ?????. Linux ???
???.
netstat -natp grep nginx
??? ?? ?? ??? ???? ????? nginx -h? ???? ?? ??(??? -p ?? -c)? ?????.
nginx? ????? ???? ???? django? python Manage.py runserver localhost:8001? ???? ???? ?? ?? ???? ????? ???? ???
??, ?? ??? ???? ?? ?? ???.
? ??? ?? ???? ??? ?????? ?????. ?? ??? ?????.