我正在为django使用apache+mod_wsgi
我的html文件使用这样的代码-
<link rel="stylesheet" type="text/css" href="http://x.x.x.x:8000/css/custom.css"/>
<script type="text/javascript" src="http://1x.x.x.x:8000/js/custom.js"></script>
我在sites-available
里的nginx配置是这样的-
server {
listen 8000;
server_name localhost;
access_log /var/log/nginx/aa8000.access.log;
error_log /var/log/nginx/aa8000.error.log;
location / {
index index.html index.htm;
}
location /static/ {
autoindex on;
root /opt/aa/webroot/;
}
}
存在具有对应的css
和js
目录的目录/opt/aa/webroot/static/
.
奇怪的是,当我访问这些页面时,它们显示得很好.
我已经清除了缓存/etc,但是从各种浏览器加载页面对我来说都很好.
另外,我在nginx日志(log)文件中没有看到404任何错误.
任何指点都会很棒.