Search code examples
iisproxywindows-serveriis-10windows-server-2019

How to set Default Proxy for "ApplicationPoolIdentity"?


We are running a dotnet-core 3.1 MVC App on IIS 10. The app needs to connect to a local ressource without the proxy.

However our IT department provisions the VMs with Proxy configuration. For a local user I can simply remove the Proxy in IE Settings, Registry or netsh.

But the app running in an application pool under the ApplicationPoolIdentity keeps using a proxy and I am out of ideas where it is getting it from. As a workaround setting the ApplicationPoolIdentity to the my local user works.

What I tried so far:

  1. Setting the web.config settings, but seems like its not working for MVC

  2. Setting Environment variables in web.config: enter image description here

  3. Setting the same Environment Variables via System Variables enter image description here


Solution

  • The solution is to actively set the Proxy variables, although you dont want to use them.

    That's because .net core automatically falls back to the user's proxy settings on windows.

    So your web.config has to look like this: enter image description here

    Attention: Be sure to write your NO_PROXY variable without * (*.domain.de) as .net core does not know how to parse it. Just use .domain.de.