I have an .Net Core (MVC 6) web application running on Linux machine via Kestrel, with NGINX serving as proxy from port 80 -> 5000 Unfortunately I´m not allowed to use default route as another application has priority, both have to run over port 80, meaning requests are forwarded like:
127.0.0.1 -> another app
127.0.0.1/conf -> my app
And in NGINX config file it's defined as:
location /conf {
proxy_pass http://127.0.0.1:5000;
proxy_cache_bypass $http_upgrade;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;
}
The thing is, if I run application using standard location ( location / ) , routing of MVC app runs fine. But having /conf appended to location simply breaks MVC routing, because application continues to return routes that are based on root location, without /conf prefix. So after user gets to default landing page, all routes (links, actions) are still pointing to address like 127.0.0.1/Home/About instead of 127.0.0.1/conf/Home/About - and to make it even worse, these links (/conf/Home/About) are not working either.
Any suggestions on how should I proceed in solving this ? Is there some NGINX-based solution or I'll have to figure some alternative on app level ?
Thanks in forward !
127.0.0.1 -> another app
127.0.0.1/conf -> my app
And in NGINX config file it's defined as:
location /conf {
proxy_pass http://127.0.0.1:5000;
proxy_cache_bypass $http_upgrade;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;
}
The thing is, if I run application using standard location ( location / ) , routing of MVC app runs fine. But having /conf appended to location simply breaks MVC routing, because application continues to return routes that are based on root location, without /conf prefix. So after user gets to default landing page, all routes (links, actions) are still pointing to address like 127.0.0.1/Home/About instead of 127.0.0.1/conf/Home/About - and to make it even worse, these links (/conf/Home/About) are not working either.
Any suggestions on how should I proceed in solving this ? Is there some NGINX-based solution or I'll have to figure some alternative on app level ?
Thanks in forward !