Merge branch 'file-upload-size-limited-behind-autoproxy-1' into 'master'

File upload size limited behind autoproxy 1

Closes #1

See merge request !1
This commit is contained in:
Joachim Lusiardi 2016-05-15 10:16:32 +02:00
commit 6ab138a392
2 changed files with 6 additions and 0 deletions

View File

@ -13,6 +13,7 @@ The following options are possible:
* **port**(optional, defaults to 80) the port on the target container
* **ip**(optional, defaults to listen on all IPs) the IP on which the proxy should listen.
* **location**(optional) if the proxied web application is not running on the /-path
* **body_size**(optional, defaults to 1MB) the allowed maximal body size as defined in http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size
## Starting the container

View File

@ -15,6 +15,8 @@ server {
listen $listen;
server_name $names;
location / {
client_max_body_size $body_size;
client_body_timeout 300s;
proxy_set_header X-Real-IP $$remote_addr;
proxy_set_header X-Forwarded-For $$remote_addr;
proxy_set_header Host $$host;
@ -31,6 +33,8 @@ server {
return 301 $$scheme://$name/$location;
}
location /$location {
client_max_body_size $body_size;
client_body_timeout 300s;
proxy_set_header X-Real-IP $$remote_addr;
proxy_set_header X-Forwarded-For $$remote_addr;
proxy_set_header Host $$host;
@ -96,6 +100,7 @@ def handle_container(id):
'location': get_if_available(proxy_data, 'location', ''),
'names': get_if_available(proxy_data, 'server_names', '').replace(';', ' '),
'port': get_if_available(proxy_data, 'port', 80),
'body_size': get_if_available(proxy_data, 'body_size', '1m'),
'listen': '*:80'
}
logging.info('writing to %sproxy_%s', target_path, id)