Angular 在NGINX上没有尾随斜杠就无法访问URL

Angular 在NGINX上没有尾随斜杠就无法访问URL,angular,nginx,nginx-location,nginx-config,trailing-slash,Angular,Nginx,Nginx Location,Nginx Config,Trailing Slash,我已经将Angular 8应用程序部署在名为test folder的子目录中的NGINX上 如果URL包含尾随斜杠,则可以成功访问应用程序。 例如:www.example.com/test/ 但是,如果通过www.example.com/test访问它,它将被加载,直到出现错误504 这是我的nginx配置文件中的代码 location /test { root /usr/share/nginx/html; index index.html index.htm; t

我已经将Angular 8应用程序部署在名为test folder的子目录中的NGINX上

如果URL包含尾随斜杠,则可以成功访问应用程序。 例如:www.example.com/test/ 但是,如果通过www.example.com/test访问它,它将被加载,直到出现错误504

这是我的nginx配置文件中的代码

location /test {
    root   /usr/share/nginx/html;
    index  index.html index.htm;
    try_files $uri $uri/ /test/index.html;
}