from http://michaelshadle.com/2009/11/01/transifex-django-nginx-on-ubuntu
You can probably also use this for just Django + nginx on Ubuntu too, it should work the same for any Django-based package, just change the Transifex-specific stuff (like /site_media and such.)
Dependencies:
- python-django package from Ubuntu (currently Jaunty's 1.0.2-1ubuntu0.1)
- Transifex installed to /home/transifex/web/transifex, from source
- Transifex setup to answer over fastcgi on port 8080
- Tested on nginx 0.7.x and 0.8.x compiled from source
/etc/nginx/nginx.conf:
04 | include /etc/nginx/confs/defaults.conf; |
06 | fastcgi_pass 127.0.0.1:8080; |
07 | include /etc/nginx/confs/django.conf; |
09 | location /site_media { |
10 | root /home/transifex/web/transifex; |
11 | include /etc/nginx/confs/expires.conf; |
14 | root /usr/share/python-support/python-django/django/contrib; |
15 | include /etc/nginx/confs/expires.conf; |
/etc/nginx/confs/defaults.conf:
10 | server_name_in_redirect off; |
/etc/nginx/confs/django.conf:
03 | fastcgi_param PATH_INFO $fastcgi_script_name; |
04 | fastcgi_param REQUEST_METHOD $request_method; |
05 | fastcgi_param QUERY_STRING $query_string; |
06 | fastcgi_param SERVER_NAME $server_name; |
07 | fastcgi_param SERVER_PORT $server_port; |
08 | fastcgi_param SERVER_PROTOCOL $server_protocol; |
09 | fastcgi_param CONTENT_TYPE $content_type; |
10 | fastcgi_param CONTENT_LENGTH $content_length; |
11 | fastcgi_pass_header Authorization; |
12 | fastcgi_intercept_errors off; |
/etc/nginx/confs/expires.conf:
1 | location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ { |
No comments:
Post a Comment