Serving Django's Media Files

Hello,

I have nginx 0.6.3 installed on Debian Etch. I am able to serve Django
pages via fcgi but I do not have any styling, CSS, or media because any
attempt to access anything in the site_media directory results in a 403
being returned by nginx. Here is what I have in my config file.

server {
listen localhost:8080;
server_name myserver;

 root /home/kane/projects/citadelle/dynaschool;

 location ~* ^.+.(html|jpg|jpeg|gif|png|ico|css|pdf|txt|js)$ {
     expires 30d;
     break;
 }

 location / {
     fastcgi_pass unix:/tmp/dynaschool.sock;
     include conf/bots.conf;
     include conf/fastcgi.conf;
 }

}

The nginx processes are owned by www-data.www-data.

ls -l /home/kane/projects/citadelle/dynaschool
… not showing various irrelevant Django files/directories
drwxr-xr-x 7 kane kane 4096 2007-10-22 02:33 site_media

Changing the ownership of site_media to www-data.www-data made no
difference. How can I get nginx serving files contained in site_media
properly?

Regards,

Clifford Ilkay
Dinamis Corporation
1419-3266 Yonge St.
Toronto, ON
Canada M4N 3P6

http://dinamis.com
+1 416-410-3326

CLIFFORD ILKAY wrote:

Hello,

I have nginx 0.6.3 installed on Debian Etch. I am able to serve Django
pages via fcgi but I do not have any styling, CSS, or media because any
attempt to access anything in the site_media directory results in a 403
being returned by nginx.

It was a silly permissions error on my part. The directory containing
site_media had needed to have the executable bit set for group and
other. Works like a charm now, thanks to the good folks on the IRC
channel who steered me in the right direction.

Regards,

Clifford Ilkay
Dinamis Corporation
1419-3266 Yonge St.
Toronto, ON
Canada M4N 3P6

http://dinamis.com
+1 416-410-3326