How do I remove x-powered-by information from my Site response headers?

Source: Internet
Author: User

X-powered-by is one of the website response header information, which is generally modified or deleted for security reasons.

If you use the node. JS Express Framework, then X-powered-by will show Express. If the THINKJS is used, then x-powered-by will show Thinkjs.1. ..

Recently, I wanted to remove this information when I was tossing the node. JS program. The specific removal method is as follows:

Delete x-powered-by in Express
var app = express();app.disable(‘x-powered-by‘);
Delete x-powered-by in Thinkjs

Under the Basecontroller of a group in app/lib/controller/, such as Home/basecontroller, add the following second line of code:

init: function(http) { http.res.removeHeader("x-powered-by"); this.super("init", http);}
Delete x-powered-by in PHP
    • The first of these methods

php.ini Setting expose_php = Off

    • The second method of
If(function_exists () {header_remove ( Span class= "token string" > ' x-powered-by ' //PHP 5.3+} else {@ini_set (  ' expose_php '  ' off ' ;}      
Delete x-powered-by in ASP.

The methods for removing HTTP headers for x-powered-by XXX in IIS 6 and IIS 7 are as follows:

x-powered-by HTTP headers do not exist only in ASP. Other server-side languages, such as PHP, will also contain this HTTP header, which, when ASP. NET is installed, is inserted into IIS as a custom HTTP header, so We need to remove this HTTP header from the configuration of IIS, and if your site is in a shared environment and you are not using IIS7 and using pipeline mode, you will have to contact your space provider to help you remove it. (If your site is in a IIS7 environment, you can programmatically remove it via the HTTP module)

Remove the x-powered-by HTTP header in IIS6 :

Start IIS, expand the website directory

Right-click on the website and select "Properties" from the popup menu.

Select the HTTP header tag, and all the custom HTTP headers included in the IIS response will be displayed here, just select the HTTP header of the response and click Delete to delete the HTTP header of the response.

The method of removing x-powered-by HTTP headers in IIS7 is:

Select the site you want to modify and double-click the HTTP response header

All the custom HTTP headers are here, delete the corresponding headers just click on the "Remove" link to the right:

How do I remove x-powered-by information from my Site response headers?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.