Hello Hasan Shehzeb ,
I understand that you’re trying to remove the Server header from your Azure Application Gateway, but it’s not working as expected.
Rewrites are not available for responses generated directly from the Application Gateway. This feature is currently unsupported and is on our backlog. While there is no estimated timeline yet, we plan to address this limitation soon.
Rewrites are not supported for 4xx and 5xx status codes, but you can try using rewrites for other types of responses.
Please check the below screen shot:
Please refer to the following document for more information:
https://learn.microsoft.com/en-us/azure/application-gateway/rewrite-http-headers-url#limitations
You may also find this Q&A thread helpful: https://learn.microsoft.com/en-us/answers/questions/627494/app-gateway-v2-unable-to-remove-server-response-he
Also, please check it in the Azure feedback link as well:
https://feedback.azure.com/d365community/idea/88a5fb41-8010-ee11-a81c-000d3adb7ffd
Hope the above answer helps! Please let us know do you have any further queries.
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.