Reverse proxy on azure app service

给你一囗甜甜゛ 提交于 2019-12-12 05:26:32

问题


I've got the asp.net web site deployed to the Azure App Service.

I need to move out the api to another website on another url. For that I've done the reverse proxy:

<rewrite>
  <rules>
    <rule name="ProxyRuleApi" stopProcessing="true">
      <match url="^api/(.*)" />
      <action type="Rewrite" url="http://anotherApiServer/api/{R:1}"/>
      <conditions>
      </conditions>
    </rule>
  </rules>
</rewrite>

But constantly get the "500" error. So looks like App Service fails to read web.config or something.. Not sure about the problem at all.

ARR turned on.

  • Anyone faced the issue?
  • What I'm doing wrong?
  • Am I doing it right?
  • How can I trace an error? (detailed errors have been turned on and custom errors I've turned off).

I've even try to

<action type="AbortRequest" />

Still got 500 status.

This is an error message:

the page cannot be displayed because an internal server error has occurred.

UPD. Solution. The problem was that I've forgot about the transformation that exists in the Web.Release.config that Applied another rewrite rules to the Web.Config. So I've updated the Web.Release.config to include my changes into the transformation.

The generated error has been generated with IIS because it was not possible to read the Web.config with twi rewrite rules defined. Azure portal helped me to find this out. App Service -> Diagnostic logs -> Turn them on and after that App Service -> Log stream. You will see the stream of the logs.

来源:https://stackoverflow.com/questions/44873404/reverse-proxy-on-azure-app-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!