nixos/lemmy: fix nginx backend to proxy needed headers (#306984)

This commit is contained in:
Yt 2024-12-06 19:27:00 -05:00 committed by GitHub
commit d530a7b9ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -204,7 +204,6 @@ in
}; };
"/" = { "/" = {
# mixed frontend and backend requests, based on the request headers # mixed frontend and backend requests, based on the request headers
recommendedProxySettings = true;
extraConfig = '' extraConfig = ''
set $proxpass "${ui}"; set $proxpass "${ui}";
if ($http_accept = "application/activity+json") { if ($http_accept = "application/activity+json") {
@ -221,6 +220,11 @@ in
rewrite ^(.+)/+$ $1 permanent; rewrite ^(.+)/+$ $1 permanent;
proxy_pass $proxpass; proxy_pass $proxpass;
# Proxied `Host` header is required to validate ActivityPub HTTP signatures for incoming events.
# The other headers are optional, for the sake of better log data.
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
''; '';
}; };
}; };