Some little problems while setting up nginx/uwsgi/django

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.

posted on 2014-12-15 14:58  一生只想往前飞  阅读(172)  评论(0编辑  收藏  举报

导航