diff --git a/.ebextensions/copy_nginx.config b/.ebextensions/copy_nginx.config new file mode 100644 index 0000000000000000000000000000000000000000..b1e306b98f955d08f5d57b47b8fdca33939cef6d --- /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 a3e0528dae60b3f6487195f1ba92305571f26bb1..9781b8a1fd31ad93a1a59557ce3689da31ab328c 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 fd94ddcae77d97de15db7436e912ab57064b3a74..1c2e7892dfacf3d71484417dc1386fd7e9a5b9d0 100644 --- a/app/config/uwsgi.ini +++ b/app/config/uwsgi.ini @@ -26,4 +26,4 @@ lazy = true lazy-apps = true # Allow longer filter params -buffer-size=32768 +buffer-size=65535