如果配置root目录不生效,需要写一个全局的root
#在server之外编写root,可以解决location中配置root不生效问题
root /usr/share/nginx/html;
location /einvoice{
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /einvoice/index.html;
}
如果配置root目录不生效,需要写一个全局的root
#在server之外编写root,可以解决location中配置root不生效问题
root /usr/share/nginx/html;
location /einvoice{
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /einvoice/index.html;
}