Hello Stanislav Grachev,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
Problem
I understand that you would like to remove or change the "server" http header on port 8172 if possible.
Solution
In Azure App Service, removing or modifying HTTP headers, including the "Server" header, typically involves configuring the web server running your application. However, the specific port 8172 is commonly used for Web Deploy, and modifying headers on this port not supported due to its specialized use and not a straightforward configuration for workaround. In summary, it is unfortunately not possible to change the WebDeploy port (which defaults to 8172) directly within Azure App Service.
So, if your requirement is to ensure no internal server information is exposed, ensure that your application does not inadvertently expose this information through other means and that your primary HTTP endpoints (80/443) are properly secured.
Alternative Approach
For alternative approaches you can consider modifying HTTP headers on standard HTTP/HTTPS ports (80/443), you can use:
- Web server configurations,
- Application-level middleware, or an
- Azure Application Gateway,
- ZipDeploy.
I provided more links on how you can do the above listed if there is need in the reference:
References
Source: How to Modify HTTP Headers in Apache. Accessed, 6/22/2024.
Source: NGINX Add Headers Module. Accessed, 6/22/2024.
Source: Application-level Middleware. Accessed, 6/22/2024.
Source: Modify HTTP headers using Azure Application Gateway. Accessed, 6/22/2024.
Source: ZipDeploy (Azure App Service). Accessed, 6/22/2024.
Accept Answer
I hope this is helpful! Do not hesitate to let me know if you have any other questions.
** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful ** so that others in the community facing similar issues can easily find the solution.
Best Regards,
Sina Salam