iis-7.5netscaler

NetScaler/IIS: 413 Entity Too Large


I am facing an issue where I am getting a 413 Request Entity Too Large whenever I post/put JSON to our servers running IIS 7.5 through a Citrix NetScaler.

We have tried to set the aspnet:MaxJsonDeserializerMembers to 30000, 40000 and 512000, as so:

<appSettings>
  <add key="aspnet:MaxJsonDeserializerMembers" value="xxx" />
</appSettings>

as well as setting the <jsonSerialization maxJsonLength="xxx"/>

But without any resolution.

Setting the aspnet:MaxJsonDeserializerMembers in our local test environment, where we don't have a Citrix NetScaler, works just fine .

Is there any settings in the NetScaler that I should know of? or Is there some IIS settings I have to be aware of as well, considering that this works in our local test environments I am leaning towards the later, but I wan't all basis covert.


Edit: After further investigation, it surely seems that the NetScaler is the source as we can post to the API from behind the NetScaler.


Solution

  • As it turns out, it was actually a combination between the two products.

    Internally we use SSL and Client Certificates which means we needed to configure a IIS property called "uploadReadAheadSize"

    http://forums.asp.net/t/1702122.aspx?cannot+find+uploadReadAheadSize+in+applicationHost+config+in+IIS7+5

    This is done in the host config or though the IIS manager.

    ...
    <system.webServer>
     <serverRuntime uploadReadAheadSize="{BYTES}" />
    </system.webServer>
    ...
    

    We used 10 MB = 10485760 Bytes for now which shows to be enough. Since this is defaulted to 48KB you may reach this rather fast.