413 - Request Entity Too Large IIS and SSL

19,638

IMPORTANT: this answer is available with HTTPS

  1. Goto configure directory

    C:/Windows/System32/inetsrv/config/

  2. Open applicationHost.config file in edit mode.

  3. Add this configure for your application

    Example: configure for 1 MB uploading

<location path="SiteName" overrideMode="Allow">
   <system.webServer>
     ......
      <serverRuntime enabled="true" uploadReadAheadSize="1024000" />     
     .....
   </system.webServer>
</location>
  1. Restart your site in the IIS
Share:
19,638

Related videos on Youtube

HansElsen
Author by

HansElsen

I'm an entrepreneurial IT specialist, with special interests in web development. I'm trying SO to learn a lot more about my own and other's problems. Checkout my AngularJS plugin GitHub https://github.com/hanselsen/ngTour Demo http://hanselsen.github.io/ngTour/

Updated on July 22, 2022

Comments

  • HansElsen
    HansElsen almost 2 years

    I get this error, the moment when I try to send a very large POST call to an Asp.net Web API over SSL.
    I am aware of the fenomenon of renegotiation.
    My uploadReadAheadSize is set to the max. (2147483647)

    Can anybody tell me some options I should try?

    Here is are request and response from Chrome dev console:

    enter image description here

    I have also tried the following commands without results:

    C:\Windows\System32\inetsrv\appcmd.exe set config "Web API" -section:system.webServer/ServerRuntime /enabled:"1024000" /commit:apphost

    C:\Windows\System32\inetsrv\appcmd.exe set config "Web API" -section:system.webServer/ServerRuntime /uploadReadAheadSize:"1024000" /commit:apphost