Azure App Container and App Gateway – “host name” is not correct

  Kiến thức lập trình

I’ve implemented a Container App with an Application Gateway on Azure. In the Application Gateway, the “Backend Setting” configuration is set as follows:

  • “Override with new host name” = “Yes”
  • “Host name override” = “Pick hostname from backend target”

Using the Application Gateway Public IP, I can correctly visualize the website.

However, when clicking on a link, I receive a “wrong page” error because all relative URLs contain the Container App URL (e.g., https://container-app-name1.orangeglacier-859ee193.italynorth.azurecontainerapps.io) instead of the Application Gateway IP.

I’ve also tried to print the $_SERVER['HTTP_HOST'] variable and it contains container-app-name1.orangeglacier-859ee193.italynorth.azurecontainerapps.io.

What could be causing this issue and how can I ensure that all relative URLs use the Application Gateway IP?

Thank you!

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT