So I'm using PCF as a PAAS solution for our web application. We are using Angular 7 for our frontend, and have some routing enabled in the application.
The application upon entry goes to the route /home
.
We have a few spots on our app that go to a details page, and each of them has a certain id.
So for example, we'll click on something on the page and it goes to /home/details/2
.
The page is database driven, as each block on the page is pulled from the DB and that's how the id is given.
However, I'm having difficulties configuring that in the nginx conf. The staticfile buildpack doesn't work for this purpose, as when I click on any of those blocks to go to another page, I just get rerouted to the main page.
In the nginx conf I've tried this:
location /home/details/ {
try_files $uri $uri/ /index.html;
}
And this:
location /home/details/ {
try_files $uri $uri/ =404;
}
Which hasn't worked, and just results in the page not loading. I'm not sure what how I need to configure nginx to get routing working for my Angular app.