Fix for docker_nginx_auto_proxy/issues/1
This commit is contained in:
parent
41fedc251b
commit
1bbeba0201
|
@ -13,6 +13,7 @@ The following options are possible:
|
||||||
* **port**(optional, defaults to 80) the port on the target container
|
* **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.
|
* **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
|
* **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
|
## Starting the container
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ server {
|
||||||
listen $listen;
|
listen $listen;
|
||||||
server_name $names;
|
server_name $names;
|
||||||
location / {
|
location / {
|
||||||
client_max_body_size 100m;
|
client_max_body_size $body_size;
|
||||||
client_body_timeout 300s;
|
client_body_timeout 300s;
|
||||||
proxy_set_header X-Real-IP $$remote_addr;
|
proxy_set_header X-Real-IP $$remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $$remote_addr;
|
proxy_set_header X-Forwarded-For $$remote_addr;
|
||||||
|
@ -33,7 +33,7 @@ server {
|
||||||
return 301 $$scheme://$name/$location;
|
return 301 $$scheme://$name/$location;
|
||||||
}
|
}
|
||||||
location /$location {
|
location /$location {
|
||||||
client_max_body_size 100m;
|
client_max_body_size $body_size;
|
||||||
client_body_timeout 300s;
|
client_body_timeout 300s;
|
||||||
proxy_set_header X-Real-IP $$remote_addr;
|
proxy_set_header X-Real-IP $$remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $$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', ''),
|
'location': get_if_available(proxy_data, 'location', ''),
|
||||||
'names': get_if_available(proxy_data, 'server_names', '').replace(';', ' '),
|
'names': get_if_available(proxy_data, 'server_names', '').replace(';', ' '),
|
||||||
'port': get_if_available(proxy_data, 'port', 80),
|
'port': get_if_available(proxy_data, 'port', 80),
|
||||||
|
'body_size': get_if_available(proxy_data, 'body_size', '1m'),
|
||||||
'listen': '*:80'
|
'listen': '*:80'
|
||||||
}
|
}
|
||||||
logging.info('writing to %sproxy_%s', target_path, id)
|
logging.info('writing to %sproxy_%s', target_path, id)
|
||||||
|
|
Loading…
Reference in New Issue