您的位置:首页 > 运维架构 > Nginx

Some little problems while setting up nginx/uwsgi/django

2014-12-15 14:58 344 查看
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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: