nginx rule to serve root
I would like to nginx to serve a static file from website root ( : http://localhost:8080/ ) but it serves my proxy pass; 开发者_JAVA百科it serves "/" rule instead of "= /".
Here is what my nginx config look like :
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/;
}
Did i miss something ?
Use this one:
location = / {
index index.html;
}
location = /index.html {
root /your/root/here;
}
精彩评论