从设置URL重写头在Azure网站 - APPCMD或对ApplicationHost.config? [英] Set header from URL Rewrite on Azure Websites - AppCmd or applicationhost.config?

查看:440
本文介绍了从设置URL重写头在Azure网站 - APPCMD或对ApplicationHost.config?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设置一个请求头(HTTP_HOST是precise)从Web.config文件,使用IIS URL重写模块,在Azure上的网站。基本上我想有这样的事情在我的网站的Web.config:

I'd like to set a request header (HTTP_HOST to be precise) from Web.config, using the IIS URL Rewrite module, on Azure Websites. Basically I'd like to have something like this in my site's Web.config:

<system.webServer>
  <rules>
    <clear />
    <rule name="My rule" enabled="true">
      <match url=".*" />
      <serverVariables>
        <set name="HTTP_HOST" value="my value" />
      </serverVariables>
      <action type="None" />
    </rule>

这导致在该HTTP_HOST不允许进行设置的错误。这是正常的,并与标准的IIS的下一个步骤将是HTTP_HOST添加到&LT; allowedServerVariables&GT; 元素直接或通过APPCMD的applicationHost.config。不过,我找不到任何提示就能够以某种方式访问​​该配置。

This results in an error that HTTP_HOST is not allowed to be set. This is normal and with standard IIS the next step would be to add HTTP_HOST to the <allowedServerVariables> element to applicationhost.config directly or through AppCmd. However I couldn't find any hints on being able to access this config somehow.

是否有可能以某种方式修改APPHOST配置,或添加允许的服务器变量在某种程度上别的吗?

Is it possible to somehow modify the apphost config, or add allowed server variables somehow else?

推荐答案

这个答案已经过时的(应该被删除)。

这篇关于从设置URL重写头在Azure网站 - APPCMD或对ApplicationHost.config?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆