我想nginx从网站root(:http://localhost:8080/)提供静态文件,但它提供我的代理通行证;它提供“/”规则而不是“= /".
这是我的nginx配置的样子:
listen 0.0.0.0:8080;
server_name localhost;
set $static_dir /path/to/static/
location = / {
# got index.html in /path/to/static/html/index.html
root $static_dir/html/;
}
location / {
# ...
proxy_pass http://app_cluster_1/;
}
我错过了什么吗?
答案 0 :(得分:3)
使用这个:
location = / {
index index.html;
}
location = /index.html {
root /your/root/here;
}