The other day we started an scenario were the Web Application Proxy (WAP) was involved, we needed to publish a web application trough it. Internally everything was working fine, but suddenly we realized that when a user was trying to access outside from the network and was using the WAP to access to the WebApp, we were receiving an error line “The Resquest URL is invalid”. So we know that the error was in the WAP and not in the WebApp, so we started to investigate the error.
We came into a KB article (https://support.microsoft.com/en-us/kb/820129) where it claims that it is not possible to have an url larger than 260 characters, in our case the query has 322, so we were over passing the limitation… ouch!
Luckily, we found a way to solve the problem, it is possible to increase the limit, in this case, we need to edit the windows registry in order to accept url longer than 260. To do that we need to:
- Open regedit in the WAP
- Navigate to HKEY_LOCAL_MACHINESystemCurrentControlSetServicesHTTPParameters
- Create a UrlSegmentMaxLength DWORD and set it to 500 (or the value yo need)
- Reboot the server
After doing this, we were able to navigate to all the pages in the web application and execute the different querys we have
Hope it helps!