From: Dessalines Date: Wed, 21 Oct 2020 09:47:45 +0000 (-0400) Subject: Fix IP forwarding headers. Fixes #1214 (#1215) X-Git-Url: http://these/git/%7B%60/feeds/inbox/static/README.zh.hant.md?a=commitdiff_plain;h=1b62e65a5df04fd0d4b8b328a673e2927fc30389;p=lemmy.git Fix IP forwarding headers. Fixes #1214 (#1215) --- diff --git a/ansible/templates/nginx.conf b/ansible/templates/nginx.conf index 03b139bb..0874be8f 100644 --- a/ansible/templates/nginx.conf +++ b/ansible/templates/nginx.conf @@ -53,10 +53,6 @@ server { # frontend location / { - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # The default ports: # lemmy_ui_port: 1235 # lemmy_port: 8536 @@ -82,6 +78,11 @@ server { # Rate limit limit_req zone=lemmy_ratelimit burst=30 nodelay; + + # Add IP forwarding headers + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }