Reverse proxy X-Forwarded-For

I recently migrated my forum to a much more performant host, and I am working towards high availability.

in the reverse proxy I added the Forward Proto and For headers but the nginx configuration on the discourse only respected the Proto.

I had to add under server:

set_real_ip_from loadbalancerip;
real_ip_header X-Forwarded-For;

Is there a discourse envvar to add these?
or possibly a argument to add to app.yml?

I believe this is what you’re looking for:

No this guide explains how to setup an nginx socket that’s shared between the container and host.

I’m trying to find a declarative way to include:

set_real_ip_from loadbalancerip;
real_ip_header X-Forwarded-For;

In the nginx configuration in containers after rebuild.

You’re trying to add this to the container’s internal nginx? I believe that’s unnecessary because it’s added by default:

This line is needed for that to work.
Without it all the requests are still the loadbalancer IP.
I know because my discourse was down for 429 errors.

In case it’s not clear this is my infra:
user > haproxy > discourse

Discourse of course includes an nginx rproxy

I included the forwarding headers in haproxy but the discourse internal nginx was not respecting forwarded for. I had to add the 2 lines in my OP and restart the container for it to work.