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:
commit
6ab138a392
|
@ -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,6 +15,8 @@ server {
|
||||||
listen $listen;
|
listen $listen;
|
||||||
server_name $names;
|
server_name $names;
|
||||||
location / {
|
location / {
|
||||||
|
client_max_body_size $body_size;
|
||||||
|
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;
|
||||||
proxy_set_header Host $$host;
|
proxy_set_header Host $$host;
|
||||||
|
@ -31,6 +33,8 @@ server {
|
||||||
return 301 $$scheme://$name/$location;
|
return 301 $$scheme://$name/$location;
|
||||||
}
|
}
|
||||||
location /$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-Real-IP $$remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $$remote_addr;
|
proxy_set_header X-Forwarded-For $$remote_addr;
|
||||||
proxy_set_header Host $$host;
|
proxy_set_header Host $$host;
|
||||||
|
@ -96,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