I'm bit lost on how serve my angular app with nginx. The requirements are that the url for accessing the app will fall under: www.domain-name.com/rte
www.domain-name.com/rte
I have the app files on a docker on the path: /usr/share/nginx/html/
/usr/share/nginx/html/
And my default.conf looks like:
location /rte { alias /usr/share/nginx/html/; try_files $uri$args $uri$args $uri $uri/ /index.html; }
But when I try to access the page, a timeout happens.
I've tried with this aswel:
location /rte/
and a 404 is thrown.
Edit: my index.html has -> base href="/"
base href="/"
The solution was to add /rte/ on try_files $uri$args $uri$args $uri $uri/ /rte/index.html;
try_files $uri$args $uri$args $uri $uri/ /rte/index.html;
And as Richards commented, I had to add the /rte/ on the index html base href as well:
base href="/rte/"
1.4m articles
1.4m replys
5 comments
56.9k users