Hello,
Welcome to Microsoft Q&A,
To configure Azure Application Gateway to add a custom header to responses, you can utilize its header rewrite capability. This feature allows you to insert, remove, or modify HTTP headers in both request and response messages.
https://learn.microsoft.com/en-us/azure/application-gateway/rewrite-http-headers-portal
You can create and set the custom header "X-Backend-Server". If you want to dynamically insert the backend server's IP address or hostname, you can use server variables like {server_name}
or {server_ip}
.
After defining the rule, associate the rewrite set with the appropriate listener or routing rule.
Please Upvote and accept the answer if it helps!