欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Asp.net移除Server,X-Powered-By和X-AspNet-Version頭

 更新時(shí)間:2024年02月02日 11:46:10   作者:code12313  
這篇文章主要介紹了Asp.net移除Server,?X-Powered-By,?和X-AspNet-Version頭,移除X-AspNet-Version很簡(jiǎn)單,只需要在Web.config中增加相應(yīng)配置節(jié),感興趣的朋友一起看看吧

移除X-AspNet-Version很簡(jiǎn)單,只需要在Web.config中增加這個(gè)配置節(jié):

<httpRuntime enableVersionHeader="false" />

 移除Server在Global.asax文件總增加:

     //隱藏IIS版本
protected void Application_PreSendRequestHeaders()
{
         HttpContext.Current.Response.Headers.Remove("Server");
        HttpContext.Current.Response.Headers.Remove("X-AspNet-Version");  //X-Powered-By
        HttpContext.Current.Response.Headers.Remove("X-Powered-By");
        HttpContext.Current.Response.Headers.Remove("ETag");
}

移除X-Powered-By需要在IIS中HTTP響應(yīng)頭刪除 X-Powered-By選項(xiàng)即可。

如果Server去不掉安裝urlscan

安裝時(shí)如果提示“IIS Metabase isrequired to install microsoft urlscan filter v3.1”

需要安裝

然后再路徑修改:C:\Windows\System32\inetsrv\urlscan

RemoveServerHeader=1,保存在重啟IIS。

如果對(duì) IIS 的 GET 請(qǐng)求返回 Microsoft-HttpApi/2.0

在注冊(cè)表中添加

reg add "HKLM\SYSTEM\CurrentControlSet\Services\HTTP\Parameters" -v "DisableServerHeader" /t REG_DWORD /d 2

如果DisableServerHeader不存在,則創(chuàng)建它(DWORD 32位)并將其值設(shè)置為2。如果存在,并且該值不為2,則將其設(shè)置為2。
最后,先調(diào)用net stop http然后net start http重新啟動(dòng)服務(wù)

net stop http /y
net start http
iisreset /RESTART

到此這篇關(guān)于Asp.net移除Server, X-Powered-By, 和X-AspNet-Version頭的文章就介紹到這了,更多相關(guān)Asp.net移除Server, X-Powered-By, 和X-AspNet-Version頭內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論