码迷,mamicode.com
首页 > 其他好文 > 详细

Some little problems while setting up nginx/uwsgi/django

时间:2014-12-15 16:46:43      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:http   io   ar   sp   for   on   art   log   bs   

I set up nginx/uwsgi/django, referencing <setting up Django and your web server with uwsgi and nginx>. That‘s quite a comprehensive and detailed article. So I just listed serveral problems I encountered during my trip.

1. "include uwsgi_params;" configuration is necessary for linking nginx and uwsgi. Otherwise, nginx can‘t forward http request to uwsgi.

2. "include mime.types;" configuration is necessary. In my scenario, all css files are fetched from nginx successfully, however, the browser does not apply them to html elements. Why? Nginx serves file with default content type as "application/octec-stream", so the browser does not regard *.css files it received as "text/css", so it does not draw pages correctly.

3. For some requests, uwsgi will complain "IO Error: write error". It‘s probably caused by permission mechanism. Check nginx‘s error log (Which is configured like "error_log /tmp/nginx.error.log;"). Usually the error log will show you on which files nginx does not have permissions. Either make the files writable, or configure nginx via "user user_name group_name;". user_name and group_name must have write permissions over the target files.

Some little problems while setting up nginx/uwsgi/django

标签:http   io   ar   sp   for   on   art   log   bs   

原文地址:http://www.cnblogs.com/linghuaichong/p/4164885.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!