I had the need to have my application running in a kubernetes cluster using nginx ingress proxy. And also have a bunch of redirect domains to point to the main appplication domain. At first I had some troubles to understand how to create a redirect url that didn’t collide with the application routes. As it turns out you should see each ingress configration in kubernetes as it’s own nginx server configuration or virtualhost in apache terms. So my solution became to create a separate ingress configuration with the redirect rule and associate all my domains I wanted to redirect to the main application. Overall it became quite simple and easy once I got the hang of how ingress scopes nginx resources.
How my setup became without the whole setup of our application parameters and domains: