How to handle 404 with paketo-buildpacks/web-servers #280
Replies: 1 comment
-
|
It sounds like you want push-state support. That's typically what you want for a SPA app. Try setting https://paketo.io/docs/howto/web-servers/#enable-push-state-routing-1
It will generate one by default, but you can override if you just put
I use this for a number of React.js apps and it works great. Your milage may vary, but I find it's a good place to start. We did go with a custom nginx.conf but that was to have better control over how it's caching files. The default caching is a little wonky because by default buildpacks will squash all the timestamps so the app image is reproducible. This is a problem because some HTTP caching works on the last modified date. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When I build my angular app with
the container is working, but if I manually type in the browser a wring url like
http://localhost:8080/worng-urland hit enter i get not found.I know what the issue is, I need
in my
nginx.conf, but how do I place it there.?Also can I just tell the buildpacks to use an
nginx.conffrom my file system? It was not mentioned hereDocs
And if you know a smarter way of building SPA angular apps and I am using the worng builders, just tell me.
Beta Was this translation helpful? Give feedback.
All reactions