Skip to content
This repository was archived by the owner on Feb 9, 2023. It is now read-only.

Commit 141b0cd

Browse files
authored
Merge pull request #7 from simontsang168/master
added client_max_body_size config
2 parents bdbf1c9 + 265abb7 commit 141b0cd

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

dockercloud.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ def node
7979
attributes['container_envvars'].find {|e| e['key'] == 'DOCKERCLOUD_NODE_FQDN'}['value']
8080
end
8181

82+
def client_max_body_size
83+
attributes['container_envvars'].find {|e| e['key'] == 'NGINX_CLIENT_MAX_BODY_SIZE'}['value'] || '1m'
84+
end
85+
8286
def running?
8387
['Starting', 'Running'].include?(attributes['state'])
8488
end
@@ -123,6 +127,10 @@ def ssl?
123127
@ssl ||= containers.first.ssl? rescue nil
124128
end
125129

130+
def client_max_body_size
131+
@client_max_body_size ||= containers.first.client_max_body_size rescue "1m"
132+
end
133+
126134
def running?
127135
@state ||= begin
128136
['Running', 'Partly running'].include?(attributes['state'])

nginx.conf.erb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ server {
6262

6363
server {
6464
server_name <%= service.host %>;
65+
client_max_body_size <%= service.client_max_body_size %>;
6566
listen 443 ssl http2;
6667

6768
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
@@ -85,6 +86,7 @@ server {
8586

8687
server {
8788
server_name <%= service.host %>;
89+
client_max_body_size <%= service.client_max_body_size %>;
8890
location / {
8991
proxy_pass http://<%= service.name %>;
9092
}

0 commit comments

Comments
 (0)