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
angularjs nginx nginx-location


source to share


No one has answered this question yet

Check out similar questions:

376
Nginx is a static file mess with root and alias
five
NGINX + Rails: serving a static directory, index.html and all other routes for rails?
1
Respond from index.html to a directory request in an nginx service application
1
nginx and nodejs serve images from dynamic folder
1
nginx escape_fragment rewrite for corner SPA static content
1
Nginx is sent to <domain> /index.html/index.html
1
Serve multiple React apps from a single server with Nginx
0
Nginx tries and serves two different directories
0
Nginx won't open index.html in subfolder
0
nginx overwrite location to local



All Articles
Loading...
X
Show
Funny
Dev
Pics