Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Error when behind corporate proxy on Windows: Self-referential requests to proxy are forbidden #76

@dirvo

Description

@dirvo

Problem description:

After upgrading a project from version 3.0.0 to version 3.1.2 of vueclimiddleware, I get the following response when accessing the app via its reverse proxy URL at https://localhost:/ with an HTTP 200 status:

<HTML><TITLE>Forbidden</TITLE><H1>Self-referential requests to proxy are forbidden</H1>Self-referential requests to this proxy server are forbidden</HTML>

Steps to reproduce

I reproduced this problem on Windows 10 2004, .NET Core 3.1

  • Being behind a corporate proxy, I have set the environment variables HTTP_PROXY=http://<proxy>:<port> and NO_PROXY=localhost .
  • Start the sample app in /samples/VueCliSample in this repo.

The browser opens at https://localhost:44323/ and displays the error message from above.

Workaround

The problem is caused by .NET Core 3.1 apparently ignoring the NO_PROXY variable and probably needs to be fixed by the .NET team where a similar issue is tracked for the Angular middleware (dotnet/aspnetcore#14392).

As a workaround, the HTTP_PROXY can be unset in the launchSettings.json file:

"profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development",
        "NO_PROXY": "localhost",
        "HTTP_PROXY": ""
      }
    },
    "webapp": {
      "commandName": "Project",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "http://localhost:8080"
    }
  }

I'd suggest adding this to the documentation / wiki as a know issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions