Azure App service - Custom 404 error page when accessing Virtual IP address

HOANG VAN SANG 20 Reputation points
2024-11-12T08:30:10.5833333+00:00

User's image

Hi, is there any way I can custom 404 error page when accessing Virtual IP address?

If the user knows the server ip (even though the domain is in cloudflare i have configured proxy) then they will know more information about the server.

(According to the principle of least precedence, it is not necessary to provide this information to the user)

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,035 questions
0 comments No comments
{count} votes

Accepted answer
  1. Luis Arias 7,686 Reputation points
    2024-11-12T11:43:51.43+00:00

    Hello HOANG,

    To create a custom 404 error page for Azure App Service's Virtual IP (VIP):

    • Deploy a custom 404 HTML page in your app and configure error handling to serve this page (e.g., in web.config for .NET).
    • Use Cloudflare to mask or block direct IP access, forcing users to access only through the domain.
    • Alternative solutions: Azure Application Gateway or Front Door can also intercept responses to display custom error pages for direct IP access.
    • Clear DNS cache (ipconfig /flushdns) to avoid cached IP mismatches.

    References

    If the information helped address your question, please Accept the answer.

    Luis

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.