deployment - django with gunicron and nginx -


i have developed django application , deploying on freebsd server using gunicron , nginx. have added guncorn in projects settings files under installedapps. , placed gunicorn.conf.py in root as:

import os  def numcpus():     if not hasattr(os, "sysconf"):         raise runtimeerror("no sysconf detected.")     return os.sysconf("sc_nprocessors_onln")  user = root workers = numcpus() * 2 + 1 bind = "127.0.0.1:8000" pidfile = "/tmp/gunicorn-srv.pid" backlog = 2048 logfile = "/data/logs/gunicorn_srv.log" loglevel = "info" 

then in nginx.conf updated server tag with:

    listen       80;     server_name localhost;      access_log   /var/log/nginx/nginx-access.log;     #charset koi8-r;      #access_log  logs/host.access.log  main;      location / {         proxy_pass   http://127.0.0.1:8000;         #root   /usr/local/www/nginx;         #index  index.html index.htm;     }      location  /media/ {         root /data/webs/uni_rate;     }     location  /static/ {         root /data/webs/uni_rate;     } 

now have started nginx , guncorn. if brows public ip page shown static files not served. if directly hit

http://myip/static/folder/file.css 

then 403 error returned. idea reason or else information should provided diagnose it.

my media , static directories respectively:

/data/webs/uni_rate/media /data/webs/uni_rate/static 

here output of nginx-access.log

182.178.6.248 - - [01/apr/2013:11:14:54 -0500] "get /static/bootstrap_toolkit_extras/css/bootstrap.css http/1.1" 403 168 "-" "mozilla/5.0 (x11; ubuntu; linux x86_64; rv :16.0) gecko/20100101 firefox/16.0" 182.178.6.248 - - [01/apr/2013:11:15:00 -0500] "-" 400 0 "-" "-" 

have checked read permission of of parent folders of /data/webs/uni_rate/? nginx user has have read access of them. example, /data, /data/webs, /data/webs/uni_rate.


Comments

Popular posts from this blog

shader - OpenGL Shadow Map -

stringtemplate - StringTemplate4 if conditional with length -