It sounds like you want to configure your Azure Application Gateway to act as a reverse proxy and forward traffic to your backend virtual machines while still preserving the original URL (in this case, the IP of the Application Gateway) in the browser's address bar. This is achievable through a combination of listener and URL path-based routing rules.
Here's a step-by-step guide on how to achieve this:
Create Backend Pools:
- In your Application Gateway configuration, ensure that you have defined backend pools for your two virtual machines (10.179.0.xx2 and 10.179.0.xx3).
Create HTTP Settings:
- Set up HTTP settings for your Application Gateway. These settings include protocol, port, and timeout configurations.
Create Listeners:
- Create an HTTPS listener for your Application Gateway. This listener should use a frontend IP configuration with the private IP (10.179.0.xx1) of the Application Gateway.
Create a URL Path-Based Routing Rule:
- Now, you'll create a URL path-based routing rule to forward traffic to your backend pools while preserving the original URL in the browser.
- Under the listener you created, go to the "Rules" tab and click on "Add a routing rule".
- Configure the rule as follows:
- Name: Give your rule a meaningful name.
- Listener: Choose the HTTPS listener you created earlier.
- Use the following settings for your conditions:
- If any of the following match the patterns:
/*
- Use the following settings for your routing settings:
- Route to: Choose your backend pool.
- Rewrite URL: Enabled (this preserves the original URL in the browser).
Test the Configuration:
- With the URL path-based routing rule in place, accessing
https://10.179.0.xx1
in a browser should now load balance traffic to your backend virtual machines (10.179.0.xx2 and 10.179.0.xx3), while the browser's address bar will still showhttps://10.179.0.xx1
.
Keep in mind that this setup might require additional configuration if your backend application has absolute URLs, as those URLs may need to be adjusted to work correctly behind the reverse proxy. Also, make sure that your backend virtual machines are configured to respond to requests for 10.179.0.xx1
.
.
Azure's documentation -->https://learn.microsoft.com/en-us/azure/application-gateway/features and https://learn.microsoft.com/en-us/azure/application-gateway/url-route-overview