How can I change headers on port 8172 in azure app service?

Stanislav Grachev 20 Reputation points
2024-06-21T21:09:02.8666667+00:00

I have an application on the azure app service. I need to remove the "server" http header on port 8172. Is this possible?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,269 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sina Salam 6,581 Reputation points
    2024-06-22T03:03:17.7733333+00:00

    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:

    1. Web server configurations,
    2. Application-level middleware, or an
    3. Azure Application Gateway,
    4. 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


0 additional answers

Sort by: Most helpful