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 <alekratz@gmail.com>
This commit is contained in:
2022-07-18 18:31:41 -07:00
parent 77bc4bbfc9
commit 0847ea310c
2 changed files with 4 additions and 1 deletions

View File

@@ -13,5 +13,7 @@ server {
location / { location / {
include uwsgi_params; include uwsgi_params;
uwsgi_pass app:3031; uwsgi_pass app:3031;
uwsgi_param HTTP_X-Forwarded-For $proxy_add_x_forwarded_for;
uwsgi_param REMOTE_ADDR $proxy_add_x_forwarded_for;
} }
} }

View File

@@ -1,5 +1,6 @@
[uwsgi] [uwsgi]
logformat = %(method) %(status) %(uri) %(proto) logformat = %(method) %(status) %(addr) %(uri) %(proto)
log-4xx = true
log-5xx = true log-5xx = true
#uid = uwsgi #uid = uwsgi
processes = 5 processes = 5