From 08539d15b9ebf43720aad7e562cca240f600580b Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 4 Apr 2018 12:42:49 -0400 Subject: [PATCH] Increase request size --- .ebextensions/copy_nginx.config | 45 +++++++++++++++++++++++++++++++++ app/config/nginx.conf | 1 + app/config/uwsgi.ini | 3 +++ 3 files changed, 49 insertions(+) create mode 100644 .ebextensions/copy_nginx.config diff --git a/.ebextensions/copy_nginx.config b/.ebextensions/copy_nginx.config new file mode 100644 index 0000000..b1e306b --- /dev/null +++ b/.ebextensions/copy_nginx.config @@ -0,0 +1,45 @@ +files: + "/etc/nginx/sites-available/blocpower.eb.nginx.conf" : + mode: "000755" + owner: root + group: root + content: | + map $http_upgrade $connection_upgrade { + default "upgrade"; + "" ""; + } + + server { + listen 80; + large_client_header_buffers 16 32k; + + gzip on; + gzip_comp_level 4; + gzip_types text/html text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; + + if ($time_iso8601 ~ "^(\d{4})-(\d{2})-(\d{2})T(\d{2})") { + set $year $1; + set $month $2; + set $day $3; + set $hour $4; + } + access_log /var/log/nginx/healthd/application.log.$year-$month-$day-$hour healthd; + + access_log /var/log/nginx/access.log; + + location / { + proxy_pass http://docker; + proxy_http_version 1.1; + + proxy_set_header Connection $connection_upgrade; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + } + +commands: + 00_enable_site: + command: 'rm -f /etc/nginx/sites-enabled/* && ln -s /etc/nginx/sites-available/blocpower.eb.nginx.conf /etc/nginx/sites-enabled/blocpower.eb.nginx.conf' + diff --git a/app/config/nginx.conf b/app/config/nginx.conf index a3e0528..9781b8a 100644 --- a/app/config/nginx.conf +++ b/app/config/nginx.conf @@ -18,6 +18,7 @@ http { error_log $NGINXERR; server { + large_client_header_buffers 16 32k; listen 80; listen [::]:80; server_name $DOMAIN; diff --git a/app/config/uwsgi.ini b/app/config/uwsgi.ini index 5790769..1c2e789 100644 --- a/app/config/uwsgi.ini +++ b/app/config/uwsgi.ini @@ -24,3 +24,6 @@ module = wsgi:app # For multithreading use lazy = true lazy-apps = true + +# Allow longer filter params +buffer-size=65535 -- GitLab