简体   繁体   English

IIS 服务器变量 SERVER_NAME 和 HTTP_HOST 来自哪里?

[英]Where do the IIS server variables SERVER_NAME and HTTP_HOST come from?

Our ASP.NET application is not working at a customer installation because ServerVariables["SERVER_NAME"] and ServerVariables["HTTP_HOST"] return the string "Arcplan".我们的 ASP.NET 应用程序在客户安装时无法运行,因为 ServerVariables["SERVER_NAME"] 和 ServerVariables["HTTP_HOST"] 返回字符串“Arcplan”。

URLs which we build on the server are then incorrect (we use Request.Url.Authority which appears to use these ServerVariables internally).然后,我们在服务器上构建的 URL 不正确(我们使用 Request.Url.Authority,它似乎在内部使用这些 ServerVariables)。

The value "Arcplan" stored in the ServerVariables does not correspond to the name of the server or web site or anything that I can find.存储在 ServerVariables 中的值“Arcplan”与服务器或网站的名称或我能找到的任何内容都不对应。 Maybe the computer was renamed and it used to be called Arcplan?也许计算机被重命名并且它曾经被称为 Arcplan?

Does anyone know where IIS gets these values from?有谁知道 IIS 从哪里获取这些值? Are they stored in a config file somewhere?它们是否存储在某个配置文件中?

Check your URL Rewrite configuration module if that thing has been set there.检查你的 URL Rewrite 配置模块,如果那个东西已经设置在那里。

Follow this link for more info: setting-http-request-headers-and-iis-server-variables点击此链接了解更多信息: setting-http-request-headers-and-iis-server-variables

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ServerVariables [“HTTP_HOST”]和ServerVariables [“SERVER_NAME”]之间有什么区别? - What's the difference between ServerVariables[“HTTP_HOST”] and ServerVariables[“SERVER_NAME”]? 使用 IIS 6/7 重写 URL - 重写主机名 {HTTP_HOST} - Url Rewriting with IIS 6/7 - Rewriting Host Name {HTTP_HOST} 如何在 ASP.NET 中重置 Request.ServerVariables("SERVER_NAME")? - How do I reset Request.ServerVariables("SERVER_NAME") in ASP.NET? HTTP错误从何而来:“尝试1次后无法联系目标服务器。”? - Where does this HTTP error come from : “Unable to contact target server after 1 tries.”? IIS AAR - 用于反向代理的URL重写 - 如何发送HTTP_HOST - IIS AAR - URL Rewrite for reverse proxy - how to send HTTP_HOST Request.ServerVariables [“SERVER_NAME”]始终是localhost - Request.ServerVariables[“SERVER_NAME”] is always localhost 为什么Request.ServerVariables [“HTTP_HOST”]与Request.Url.Host不同? - Why is Request.ServerVariables[“HTTP_HOST”] different from Request.Url.Host? IIS 8 Web服务器场中的“服务器场->服务器相似性”中的主机名相似性是什么? - What is host name affinity in Server Farm -> Server Affinity on IIS 8 Web Farm? 尝试在IIS 7中托管网站时出现“ HTTP错误500.19-内部服务器错误” - “HTTP Error 500.19 - Internal Server Error” when trying to host a website in IIS 7 并非所有数据都来自服务器 - Not all data come from server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM