Redirect Public IP to FQDN Azure App Gateway over https

Liam Cryan 0 Reputation points
2023-03-13T19:08:06.11+00:00

Hello,

I am trying to redirect traffic from public ip to FQDN in Azure over https. I am using a public endpoint to accept traffic and an application gateway to route to backend.

I can visit https://mysite.com and all works well. However, I am still able to visit my public ip directly, say https://170.147.168.170.

I currently have http to https redirection, and this routes not only http://mysite.com to https://mysite.com, but also http://170.147.168.170 to https://mysite.com I would like to route https://170.147.168.170 to https://mysite.com.

I have looked at redirect-overview documentation but the use case does not seem to fit here, or I do not understand how it does.

Is this possible using application gateway features? The reason I would like to redirect this traffic is because there is a WAF associated with the application gateway, but the WAF does not seem to apply to requests made to https://170.147.168.170.

Thanks.

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
956 questions
{count} votes

1 answer

Sort by: Most helpful
  1. msrini-MSFT 9,256 Reputation points Microsoft Employee
    2023-03-14T09:17:11.9066667+00:00

    Hi,

    You will need to perform a host name rewrite to achieve your ask.

    Reference: https://learn.microsoft.com/en-us/azure/application-gateway/rewrite-http-headers-url

    You will need to rewrite the hostname from IP to your FQDN.

    Regards,

    Karthik Srinivas

    0 comments No comments