人妻无码中文字幕永久在线,99RE6这里有精品热视频,国产成人综合色就色综合 ,蜜臀av在线观看

新聞建站cms系統(tǒng)、政府cms系統(tǒng)定制開發(fā)

廣州網(wǎng)站建設(shè)公司-閱速公司

asp.net新聞發(fā)布系統(tǒng)、報紙數(shù)字報系統(tǒng)方案
/
http://www.jdki.com.cn/
廣州網(wǎng)站建設(shè)公司
您當(dāng)前位置:首頁>網(wǎng)站技術(shù)

網(wǎng)站技術(shù)

刪除Server HTTP頭

發(fā)布時間:2019/4/6 13:01:19  作者:Admin  閱讀:497  

廣告:

下載UrlScan

Download the setup MSI file for UrlScan 3.1 from one of the following URLs to your computer:

x86: http://www.microsoft.com/downloads/details.aspx?FamilyID=ee41818f-3363-4e24-9940-321603531989

x64: http://www.microsoft.com/downloads/details.aspx?FamilyID=361e5598-c1bd-46b8-b3e7-3980e8bdf0de

安裝UrlScan(需要安裝IIS-Metabase,即IIS 6 元數(shù)據(jù)庫兼容性組件)后,

修改 C:\Windows\System32\inetsrv\urlscan\UrlScan.ini 文件,設(shè)置 RemoveServerHeader=1

然后重啟IIS

二、StripHeaders

下載:https://github.com/Dionach/StripHeaders/releases

我們只要下載msi文件點(diǎn)擊安裝,然后重啟iis就可以了。

做完之后,再打開網(wǎng)站,就會看到,所有返回的請求頭里,server信息以及X-Powered-By、X-AspNet-Version、X-AspNetMvc-Version等都消失了,并且csp也正確反饋出來了。

注意:如果沒有效果,或是頁面報錯了,可能是系統(tǒng)用戶權(quán)限不足,需要手動注冊一下這個StripHeaders。

可以用管理員權(quán)限打開命令行窗口,執(zhí)行如下命令:

C:\Windows\System32\inetsrv\appcmd.exe install module /name:StripHeadersModule /image:%windir%\system32\inetsrv\stripheaders.dll /add:true /lock:true

然后再重啟IIS服務(wù),就可以了。

三 只能在集成模式下用

MvcHandler.DisableMvcResponseHeader = true;

void Application_Start(object sender, EventArgs e)

{

// 其它內(nèi)容

// 移除 X-AspNetMvc-Version

MvcHandler.DisableMvcResponseHeader = true;

}

protected void Application_PreSendRequestHeaders(object sender, EventArgs e)

{

HttpApplication app = sender as HttpApplication;

if (app != null && app.Context != null)

{

//移除Server

app.Context.Response.Headers.Remove("Server");

//修改Server的值

app.Context.Response.Headers.Set("Server", "Tom");

//移除X-AspNet-Version,和上面效果一樣

app.Context.Response.Headers.Remove("X-AspNet-Version");

//移除X-AspNetMvc-Version,和上面效果一樣

// app.Context.Response.Headers.Remove("X-AspNetMvc-Version");

}

}

廣告:

相關(guān)文章
HTTP頭
cms新聞系統(tǒng)購買咨詢
掃描關(guān)注 廣州閱速軟件科技有限公司
掃描關(guān)注 廣州閱速科技