I have the following nginx configurations:
server {
listen 80;
charset utf-8;
client_max_body_size 5M;
location /severbat {
root /root/severbat/dist;
try_files $uri /index.html;
}
location /swagger {
root /root/av/swagger-ui-dist;
try_files $uri /index.html;
}
}
And I files /root/severbat/dist/index.html and /root/av/swagger-ui-dist/index.html exist. But if I open url http://localhost/severbat I see nginx greetings page instead of index.html
However if I serve files under / it works:
location / {
root /root/severbat/dist;
try_files $uri /index.html;
}
nginx-acesss.log:
2018/10/03 09:32:44 [debug] 23052#23052: *519 trying to use file: "/swagger" "/root/av/swagger-ui-dist/swagger"
2018/10/03 09:32:44 [debug] 23052#23052: *519 trying to use file: "/index.html" "/root/av/swagger-ui-dist/index.html"
2018/10/03 09:32:44 [debug] 23052#23052: *519 internal redirect: "/index.html?"
2018/10/03 09:32:44 [debug] 23052#23052: *519 rewrite phase: 1
2018/10/03 09:32:44 [debug] 23052#23052: *519 test location: "/severbat"
2018/10/03 09:32:44 [debug] 23052#23052: *519 test location: "/api"
2018/10/03 09:32:44 [debug] 23052#23052: *519 using configuration ""
2018/10/03 09:32:44 [debug] 23052#23052: *519 http cl:-1 max:5242880
...
2018/10/03 09:32:44 [debug] 23052#23052: *519 content phase: 17
2018/10/03 09:32:44 [debug] 23052#23052: *519 http filename: "/usr/share/nginx/html/index.html"