简体   繁体   中英

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".

URLs which we build on the server are then incorrect (we use Request.Url.Authority which appears to use these ServerVariables internally).

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. Maybe the computer was renamed and it used to be called Arcplan?

Does anyone know where IIS gets these values from? Are they stored in a config file somewhere?

Check your URL Rewrite configuration module if that thing has been set there.

Follow this link for more info: setting-http-request-headers-and-iis-server-variables

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM