Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Merge branch 'client-max-body-size'
Browse files Browse the repository at this point in the history
  • Loading branch information
tommarien committed Jan 15, 2020
2 parents 9e4290f + c623f87 commit ed2c6d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/config/lib/nginx_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class NginxConfig
basic_auth: false,
basic_auth_htpasswd_path: "/app/.htpasswd",
worker_connections: 512,
client_max_body_size: "1m",
resolver: "8.8.8.8",
logging: {
"access" => true,
Expand All @@ -23,6 +24,7 @@ def initialize(json_file)
json = {}
json = JSON.parse(File.read(json_file)) if File.exist?(json_file)
json["worker_connections"] ||= ENV["WORKER_CONNECTIONS"] || DEFAULT[:worker_connections]
json["client_max_body_size"] ||= ENV["CLIENT_MAX_BODY_SIZE"] || DEFAULT[:client_max_body_size]
json["port"] ||= ENV["PORT"] || 5000
json["root"] ||= DEFAULT[:root]
json["encoding"] ||= DEFAULT[:encoding]
Expand Down
3 changes: 3 additions & 0 deletions scripts/config/templates/nginx.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ http {
#Must read the body in 5 seconds.
client_body_timeout 5;

#Max body size (think fileuploads)
client_max_body_size <%= client_max_body_size %>;

server {
listen <%= port %> reuseport;
charset <%= encoding %>;
Expand Down

0 comments on commit ed2c6d0

Please sign in to comment.