我有以下静态文件:
/home/nginx/js/a.js
/home/nginx/errors/403.html
nginx.conf
:
[...]
location / {
root /home/nginx;
}
error_page 403 /errors/403.html;
location = /errors/403.html {
root /home/nginx;
}
[...]
403.html
代码:
[...]
<script src="js/a.js"></script>
[...]
但是它会导致错误,无法找到想要的.js
文件。
我尝试使用../js/a.js
更改它,将403.html
移动到根目录(nginx.conf's location
中的更改)但仍无效果。这是nginx配置的问题吗?