Routing issues on Angular + Kubernetes + Nginx Routing issues on Angular + Kubernetes + Nginx kubernetes kubernetes

Routing issues on Angular + Kubernetes + Nginx


The server has to send the info after the domain name to the browser to be resolved. Problem is the nginx server is doing to much processing. What needs to happen is not, to have nginx do any processing of the url if it cannot resolve the url within the it's local files, but to send the remaining url to the client in the browser. The angular routing logic will direct the router of the SPA to place the right components in the tag of the app. It needs to work like this:

  • domain-name.com/resolve-at-browser

    1. The domain name is resolved to the server where it is running (in this case nginx), where the index.html is sent back to the browser as well as a lot of javascript that is the webpack bundle full of app logic and the angular libraries.
    2. The runtime in the browser will parse the browser DOM that has the index.html loaded into it and find the tag.
    3. To resolve that, the angular runtime or the Ivy Renderer will look and the url that still has not been processed by nginx.