Application gateway not added x-forwarded-proto request header

Will Ang 20 Reputation points
2024-09-30T11:22:35.99+00:00

Application gateway front listener listen https, the backend is a container app, the backend setting listen http, when use custom domain of application gateway public ip to visit the container app web application encounter the following error, and the application trace shoulds x-forwarded-proto, x-forwarded-for, x-forwarded-host are all null,

"

jquery.min.js:2 Mixed Content: The page at 'https://simpleregimen.com/login.html?requestedUrl=http%3A%2F%2Fsimpleregimen.com%2Fem' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://simpleregimen.com/em?_=1727336261383'. This request has been blocked; the content must be served over HTTPS."

3ccf2f8cb5e47f2ee5ee4c45f9e62afa

it seems Application gateway not worked as the document say

Application gateway inserts six additional headers to all requests before it forwards the requests to the backend. These headers are x-forwarded-for, x-forwarded-port, x-forwarded-proto, x-original-host, x-original-url, and x-appgw-trace-id. The format for x-forwarded-for header is a comma-separated list of IP:port. https://learn.microsoft.com/en-us/azure/application-gateway/how-application-gateway-works#modifications-to-the-request

I tried add rewrite set to the rule, but still not work, is this a bug in the application gateway or does it require additional configuration? 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.
1,083 questions
{count} votes

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.