I am working on an asp.net core 3.1 application using mvc where I'm supposed to upload files of up to 200mb. Uploading up to 100mb works but anything above gives me a 404.
I'll say straight away that the code is not written by me and uses Kapitan to drive most of the configuration, which is completely new to me.
this is a mock of the form:
@using (@Html.BeginForm("Create", "Model", FormMethod.Post, htmlAttributes: new { @class = "form", enctype = "multipart/form-data" }))
{
<div class="form-group">
@Html.Label("x File")
@Html.TextBoxFor(x => x.Model.x, htmlAttributes: new
{
type = "file",
accept = ".x",
required = "true"
})
</div>
}
controller:
[HttpPost]
[RequestFormLimits(MultipartBodyLengthLimit = 568435456)]
public async Task<IActionResult> Create(X x)
{
}
things I've tried: add web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<httpRuntime maxRequestLength="307200" />
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="524288000" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
startup:
services.Configure<FormOptions>(options =>
{
options.MultipartBodyLengthLimit = 568435456;
});
Changing the configuration of the yml file for the proxy-body-size removed the 413 I used to get from nginx but not the 404.
UPDATE
In incognito the response becomes:
502 Bad Gateway nginx/1.17.10
What could the causes be? I tried everything I could find online.
Thank you in advance.