Code

Changes between Version 11 and Version 12 of DjangoAndNginx


Ignore:
Timestamp:
04/17/12 08:09:03 (2 years ago)
Author:
anonymous
Comment:

Fix static location to work out of the box. Add a note on security.

Legend:

Unmodified
Added
Removed
Modified
  • DjangoAndNginx

    v11 v12  
    122122                location /site_media  { 
    123123                        root /media/; # Notice this is the /media folder that we create above 
     124 
     125                        location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov) { 
     126                                access_log   off; 
     127                                expires      30d;  
     128                        } 
    124129                } 
    125                 location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov) { 
    126                         access_log   off; 
    127                         expires      30d;  
    128                 } 
     130 
    129131                location / { 
    130132                        # host and port to fastcgi server 
     
    149151/etc/init.d/nginx start 
    150152}}} 
     153 
     154Anonymous says there is a lot cleaner way to install Nginx+Django on a Debian-based system. See [http://serverfault.com/a/370573/52873 this post on stackoverflow for details]