Fix for docker_nginx_auto_proxy/issues/1

This commit is contained in:
Joachim Lusiardi 2016-05-14 18:20:28 +02:00
parent 41fedc251b
commit 1bbeba0201
2 changed files with 4 additions and 2 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,7 +15,7 @@ server {
listen $listen;
server_name $names;
location / {
client_max_body_size 100m;
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;
@ -33,7 +33,7 @@ server {
return 301 $$scheme://$name/$location;
}
location /$location {
client_max_body_size 100m;
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;
@ -100,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)