Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase max request body size to allow clients to import large projects #690

Merged
merged 4 commits into from
Sep 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Backend/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ public static void Main(string[] args)

public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.ConfigureKestrel((context, options) =>
{
// Allow clients to POST large files to servers, such as project imports.
// Note: The HTTP Proxy in front, such as NGNIX, also needs to be configured
// to allow large requests through as well.
// 250MB.
options.Limits.MaxRequestBodySize = 250_000_000;
})
.UseStartup<Startup>();
}
}
3 changes: 3 additions & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ server {
ssl_certificate_key /ssl/key.pem;
charset utf-8;

# Allow clients to import large projects.
client_max_body_size 250m;

location /v1 {
proxy_pass http://backend:5000;
proxy_http_version 1.1;
Expand Down