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.
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.
相关文章推荐
- Setting up Django and your web server with uWSGI and nginx
- Setting up Django and your web server with uWSGI and nginx
- Setting up Django and your web server with uWSGI and nginx
- Setting up Django and your web server with uWSGI and nginx
- Setting up Django and your web server with uWSGI and nginx
- Setting up Django and your web server with uWSGI and nginx
- Setting up Django with Nginx, Gunicorn, virtualenv, supervisor and PostgreSQL
- nginx django uwsgi搭建网站
- 解决nginx+uwsgi部署Django的所有问题
- nginx+django+uwsgi
- uwsgi+nginx+django+python
- Django搭建及源码分析(三)---+uWSGI+nginx
- nginx+django+mysql+uwsgi环境搭建
- 基于centos搭建nginx+uwsgi运行django环境
- centos 下 django + uwsgi + nginx 快速搭建
- Nginx+Django+Uwsgi架构部署
- nginx+uwsgi+django环境部署部署
- python django uwsgi nginx 实例
- 搭建python的web环境 Centos5.4+Nginx-0.8.50+UWSGI-0.9.6.2+Django-1.2.3搭建高性能WEB服务器环境
- Django Nginx+uwsgi 安装配置