无码国产精成人午夜视频不卡,久久久无码精品亚洲日韩蜜桃 ,国产亚洲欧美日韩在线一区 ,狠狠色丁香婷婷综合久久来来去

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

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

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

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

刪除Server HTTP頭

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

廣告:

下載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ù)庫(kù)兼容性組件)后,

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

然后重啟IIS

二、StripHeaders

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

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

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

注意:如果沒有效果,或是頁(yè)面報(bào)錯(cuò)了,可能是系統(tǒng)用戶權(quán)限不足,需要手動(dòng)注冊(cè)一下這個(gè)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)購(gòu)買咨詢
掃描關(guān)注 廣州閱速軟件科技有限公司
掃描關(guān)注 廣州閱速科技