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
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?