BUG!!!======>django1.4+nginx+admin+css 配置:nginx 403 forbidden, 找不到样式表
django安装好以后,需要配置nginx,找到nginx.conf文件进行配置的时候,location后边的写法要注意,空格。
server{ listen 80; server_name cloud.i-erya.com; location / { root /web/eatclouds; #index index.html index.htm; #autoindex on; fastcgi_pass backend_eatclouds; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_pass_header Authorization; include fastcgi_params_django; } location ^~ /site_media{ #^~ 与 /site_media之间有空格 alias /web/eatclouds/media/; } location ^~ /static { #^~ 与 /static之间有空格 alias /usr/local/python2.7.2/lib/python2.7/site-packages/django/contrib/admin/static/; } 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) { alias /web/eatclouds/sitestatic/; access_log off; # po co mi logi obrazk��w :) expires 30d; } }
“某度”空间 http://hi.baidu.com/new/wenjiashe521
cnblogs空间 http://www.cnblogs.com/wenjiashe521/