Angular SPA service and another index.html from nginx

I have a SPA and serve it from Nginx which works great. I also have a simple index.html inside a sub folder.

Spa links to index.html to display under the application, which is simple html with its own css / js. When trying to browse the application subfolders, nginx redirects to the underlying spa.

nginx config

 location / {              
                try_files $uri $uri/ /index.html =404;
        }

location /3d-viewer/ {
                 try_files $uri $uri/ /3d-viewer/index.html;
        }

      

Thanks for the help.

+3


source to share





All Articles