Skip to content

API 403 Error when using IIS as reverse proxy #957

@isaacnicholas

Description

@isaacnicholas

Describe the bug
When using IIS as a reverse proxy, I keep on getting the following 403 error from the api request. The ui page and all the css/images load fine. This brings up an error message saying that there was an error connecting to Restreamer Core. The site works fine if I directly go to server:8080. I don't think it's an IIS issue, but there's a chance a rewrite is broken somewhere.

{"code":403,"message":"Forbidden","details":["Forbidden"]}

To Reproduce
Below is my current web.config file. I've been playing with different variables but to no avail.

<configuration>
  <system.webServer>
    <proxy enabled="true" preserveHostHeader="false" />
    
    <rewrite>
      <rules>
        <rule name="RestreamerProxy" stopProcessing="true">
          <match url="^restreamer/(.*)" />
          <conditions>
             <add input="{CACHE_URL}" pattern="^(.+)://" />
          </conditions>
          <action type="Rewrite" url="{C:1}://127.0.0.1:8080/{R:1}" />
          
          <serverVariables>
            <set name="HTTP_X_FORWARDED_PROTO" value="https" />
            
            <set name="HTTP_ORIGIN" value="http://127.0.0.1:8080" />
            
            <set name="HTTP_REFERER" value="http://127.0.0.1:8080/" />
          </serverVariables>
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

Expected behavior
API should return the same 200 error as when I go to 8080 directly.

Screenshots

Image

Desktop (please complete the following information):

  • OS: Windows Server 2022 Standard
  • IIS: 10.0.20348.1

Additional context
Add any other context about the problem here.

Business inquiries

We provide support for commercial requirements with professional support, agile software development, and consulting. If you have a commercial request, be it a bug or a feature enhancement, please contact us directly at support@datarhei.com.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugProgram error or software error or software anomaly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions