#proxy_set_header

Christian Pietsch (old acct.)chpietsch@digitalcourage.social
2022-11-20

@Pertsch @digitalcourage

Stimmt, ich sollte mal öffentlich dokumentieren, wie ich das auf digitalcourage.social gemacht habe.

Ich habe einfach alle Vorkommen der folgenden Zeilen in der nginx-Konfiguration auskommentiert:

#proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

Auch unsere Metatext-User haben deswegen noch keine Probleme berichtet.

Außerdem habe ich in nginx die Access-Logs deaktiviert:
access_log off;

Das Logging abzuschalten, hilft auch der Performanz. Deshalb habe ich das auch in Mastodon abgeschaltet.

@chasalin @RoelfRenkema @vosje62 @harld

Toch niet echt 1 regel:

location / {
proxy_pass eendomeinhier.nl/;
proxy_redirect off;
proxy_buffering off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
#proxy_set_header X-Forwarded-Port $server_port;
#proxy_set_header Host $host;
}

Charims :archlinux: :sway: :vim:charims@social.pcwideopen.com
2021-03-23
I'm having issues with pleroma webui and even some user-uploaded content. API seems to be working, or I imagine I couldn't post this with husky.

I see the following in my nginx logs

2021/03/23 00:02:11 [error] 179593#179593: *84 upstream prematurely closed connection while reading upstream, client: 192.168.3.1, server: social.pcwideopen.com, request: "GET /static/css/app.77b1644622e3bae24b6b.css HTTP/2.0", upstream: "http://192.168.3.84:4000/static/css/app.77b1644622e3bae24b6b.css", host: "social.pcwideopen.com", referrer: "https://social.pcwideopen.com/"

I have tweaked these settings back and forth trying to resolve this.

location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering on;
#proxy_set_header Connection "";
#proxy_redirect off;
#proxy_request_buffering off;
#proxy_buffering off;
proxy_read_timeout 300s;
proxy_connect_timeout 300s;
proxy_buffer_size 4k;
proxy_buffers 256 4k;
#proxy_set_header X-Forwarded-For $remote_addr;
# this is explicitly IPv4 since Pleroma.Web.Endpoint binds on IPv4 only
# and `localhost.` resolves to [::0] on some systems: see issue #930
proxy_pass http://192.168.3.84:4000;
client_max_body_size 16m;
}
2019-08-09

Wir haben das jetzt so gelöst:

In /etc/nginx/sites-available/mastodon haben wir alle Zeilen auskommentiert, in denen X-Real-IP oder X-Forwarded-For vorkommen:

#proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

Nach einem `systemctl reload nginx` steht bei lokalen Usern, die sich neu eingeloggt haben, jetzt nur noch 127.0.0.1 als IP-Adresse. Und diese Instanz scheint immer noch zu funktionieren, oder?

#mastoadmin #mastodon #privacy #datenschutz #dsgvo

:mastodon: /c

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst