From 2692220d27a99f08b91d33e58558aa7b7ce5c6e8 Mon Sep 17 00:00:00 2001 From: Matti Paksula Date: Sat, 25 Jan 2020 11:38:28 +0200 Subject: [PATCH 1/2] larger --- docker-compose.yml | 6 ++++++ docker/nginx.conf | 6 ++++-- vhosts_template/default.conf.template | 8 +++++--- 3 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..d8634f3 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,6 @@ +version: "3.6" + +services: + nginx-proxy: + build: . + image: mattipaksula/nginx-proxy:v2 diff --git a/docker/nginx.conf b/docker/nginx.conf index 5e70c80..afdc637 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -14,7 +14,7 @@ events { http { include /etc/nginx/mime.types; default_type application/octet-stream; - + log_format main '$host $remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; @@ -71,6 +71,8 @@ http { proxy_set_header Proxy ""; + client_max_body_size 9999m; + include /etc/nginx/conf.d/*.conf; -} \ No newline at end of file +} diff --git a/vhosts_template/default.conf.template b/vhosts_template/default.conf.template index 3a3d9ba..09846d2 100644 --- a/vhosts_template/default.conf.template +++ b/vhosts_template/default.conf.template @@ -34,9 +34,10 @@ server{ proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_read_timeout 7d; - proxy_send_timeout 7d;{% endif %} + proxy_send_timeout 7d; + client_max_body_size 9999m;{% endif %} }{% endfor %} - + }{% else %} server{ listen {{ server.port }}; @@ -51,7 +52,8 @@ server{ proxy_read_timeout 7d; proxy_send_timeout 7d; proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "Upgrade";{% endif %} + proxy_set_header Connection "Upgrade"; + client_max_body_size 9999m;{% endif %} }{% endfor %} location /.well-known/acme-challenge/ { alias {{ challenge_dir }}; From 94d49899dc79ab218a385226e790cee35b094f80 Mon Sep 17 00:00:00 2001 From: Matti Paksula Date: Sat, 25 Jan 2020 11:47:47 +0200 Subject: [PATCH 2/2] works --- docker-compose.yml | 2 +- docker/nginx.conf | 2 -- vhosts_template/default.conf.template | 8 ++++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index d8634f3..bc2db0e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,4 +3,4 @@ version: "3.6" services: nginx-proxy: build: . - image: mattipaksula/nginx-proxy:v2 + image: mattipaksula/nginx-proxy:v3 diff --git a/docker/nginx.conf b/docker/nginx.conf index afdc637..faa9cf4 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -71,8 +71,6 @@ http { proxy_set_header Proxy ""; - client_max_body_size 9999m; - include /etc/nginx/conf.d/*.conf; } diff --git a/vhosts_template/default.conf.template b/vhosts_template/default.conf.template index 09846d2..df730e7 100644 --- a/vhosts_template/default.conf.template +++ b/vhosts_template/default.conf.template @@ -22,6 +22,7 @@ server{ ssl_certificate_key /etc/ssl/private/{{ server.ssl_file }}.key; ssl_stapling on; ssl_stapling_verify on; + client_max_body_size 9999m; add_header Strict-Transport-Security "max-age=31536000" always; {% for location in server.locations %} location {{ location.name }} { {% if location.upstream %} @@ -34,14 +35,14 @@ server{ proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_read_timeout 7d; - proxy_send_timeout 7d; - client_max_body_size 9999m;{% endif %} + proxy_send_timeout 7d;{% endif %} }{% endfor %} }{% else %} server{ listen {{ server.port }}; server_name {{ server.hostname }};{% for location in server.locations %} + client_max_body_size 9999m; location {{ location.name }} { {% if location.upstream %} proxy_pass {{ location.container.scheme }}://{{ location.upstream }}{{location.container.path}};{% else %} proxy_pass {{location.container.scheme }}://{{ location.container.address }}:{{ location.container.port }}{{ location.container.path }};{% endif %}{% if location.name != '/' %} @@ -52,8 +53,7 @@ server{ proxy_read_timeout 7d; proxy_send_timeout 7d; proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "Upgrade"; - client_max_body_size 9999m;{% endif %} + proxy_set_header Connection "Upgrade";{% endif %} }{% endfor %} location /.well-known/acme-challenge/ { alias {{ challenge_dir }};