]> Untitled Git - lemmy.git/commitdiff
Fix IP forwarding headers. Fixes #1214 (#1215)
authorDessalines <dessalines@users.noreply.github.com>
Wed, 21 Oct 2020 09:47:45 +0000 (05:47 -0400)
committerGitHub <noreply@github.com>
Wed, 21 Oct 2020 09:47:45 +0000 (09:47 +0000)
ansible/templates/nginx.conf

index 03b139bb0563547e1adc0d7b6ab4165894ca842e..0874be8f9c853fecd5b9223d6a4c11439a0f0c50 100644 (file)
@@ -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;
     }