python - nginx的静态文件没有端口号就无法访问
PHPz
PHPz 2017-04-18 09:38:34
0
3
338

我的nginx在网页的静态文件上遇到了一些问题
目前查看网页上解析出来css的地址在http://138.128.197.124/static...
我的location部分这么写的
location /static/ {
alias /root/djangoBlog/jasonBlog/static/;
}
确认过所有的static文件都是在这个目录下面的,想请问下为何无法访问呢
在想是不是因为我监听的是8077端口,这里的css地址也应该是ip:8077?请问该如何修改呢

PHPz
PHPz

学习是最好的投资!

reply all(3)
迷茫

Thank you for your help. I found the problem. The permissions I configured for nginx were not enough. I will fix it after modifying it.

洪涛

You can only forward it if you request the port you are listening on in nginx. You requested port 80, so naturally it cannot be found.

阿神
location /static/ {
alias /root/djangoBlog/jasonBlog/static/;
}

Just put this part on port 80
Or you can proxy port 8077 under port 80

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template