From 0847ea310c6078e9f6e101407d41540cc096465b Mon Sep 17 00:00:00 2001 From: Alek Ratzloff Date: Mon, 18 Jul 2022 18:31:41 -0700 Subject: [PATCH] Add some forwarding options to nginx and some log stuff to uwsgi * nginx needs to add X-Forwarded-For and REMOTE_ADDR headers to get the IP address properly * uwsgi now logs 400 errors and adds the REMOTE_ADDR to the log file Signed-off-by: Alek Ratzloff --- nginx.conf | 2 ++ uwsgi.ini | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index cd16a31..789f038 100644 --- a/nginx.conf +++ b/nginx.conf @@ -13,5 +13,7 @@ server { location / { include uwsgi_params; uwsgi_pass app:3031; + uwsgi_param HTTP_X-Forwarded-For $proxy_add_x_forwarded_for; + uwsgi_param REMOTE_ADDR $proxy_add_x_forwarded_for; } } diff --git a/uwsgi.ini b/uwsgi.ini index e8836c9..ca7083e 100644 --- a/uwsgi.ini +++ b/uwsgi.ini @@ -1,5 +1,6 @@ [uwsgi] -logformat = %(method) %(status) %(uri) %(proto) +logformat = %(method) %(status) %(addr) %(uri) %(proto) +log-4xx = true log-5xx = true #uid = uwsgi processes = 5