簡體   English   中英

global.asax 代碼在本地運行良好,但在 IIS 上部署后無法正常運行

[英]global.asax code working fine in local but not after deploying on IIS

我在 global.asax 中有以下代碼。 我在本地獲取 remote_addr 詳細信息,但在部署后沒有。

log4net.GlobalContext.Properties["username"] = System.Net.Dns.GetHostEntry(Request.ServerVariables["remote_addr"]).HostName.ToString();

要獲取主機名,您需要打開反向 dns 查找。 這是 IIS 中的行為變化。 system.webServer/security/ipSecurity@doReverseDns 並獲取 REMOTE_HOST 服務器變量。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM