aspnetcore-vueclimiddleware
aspnetcore-vueclimiddleware copied to clipboard
Error when behind corporate proxy on Windows: Self-referential requests to proxy are forbidden
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:
<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>andNO_PROXY=localhost. - Start the sample app in
/samples/VueCliSamplein 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 (https://github.com/dotnet/aspnetcore/issues/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