I've got 2 Servers with 1 Public IP and 1 Domain running IIS with same Web API but one is the production and one the beta server. I want to redirect the request internaliy to the production or the beta server upon a request header.
for example: X-Environment = Production or X-Environment = Beta
2 Posts
Reverse Proxy / URL rewrite upon Request Header
Oct 28, 2016 12:58 PM|flostony|LINK
Hi!
I've got 2 Servers with 1 Public IP and 1 Domain running IIS with same Web API but one is the production and one the beta server. I want to redirect the request internaliy to the production or the beta server upon a request header.
for example:
X-Environment = Production or
X-Environment = Beta
Is this possible to achive with ARR?
5494 Posts
MVP
Moderator
Re: Reverse Proxy / URL rewrite upon Request Header
Oct 28, 2016 10:50 PM|Rovastar|LINK
sure you can create urlrewrite based on any header to route to any server farm.
but also consider that your solution is very poor security standards anyone could add these headers in.
Better to base it on the clients IP address.
https://www.leansentry.com/
4042 Posts
Re: Reverse Proxy / URL rewrite upon Request Header
Oct 31, 2016 02:47 AM|Yuk Ding|LINK
Hi flostony,
You could pattern the request header by adding the following section in you rewrite rule::
Besides, you could try to configure reverse proxy based on x-environment header with the following link:
https://www.iis.net/learn/extensions/url-rewrite-module/reverse-proxy-with-url-rewrite-v2-and-application-request-routing
This rewrite rule could be a demo to send the request to different server.
Best Regards,
Yuk Ding
MSDN Community Support
Please remember to "Mark as Answer" the responses that resolved your issue.
2 Posts
Re: Reverse Proxy / URL rewrite upon Request Header
Nov 14, 2016 07:46 AM|flostony|LINK
Thanks Yuk Ding for the short example!!