are you using a 2-containter build?
i don’t think there is built-in env variable for custom load balancer IPs, because nginx doesn’t natively read those vars for the server block.
also, if you manually edited the nginx config inside the running container, it will be wiped out the next time you rebuild.
i think in order to make it permanent and survive rebuilds, you need to use the replace command in your app.yml (or web_only.yml if dual container) - scroll to the very bottom of your .yml file to the run: section, and add this block. it tells the discourse builder to automatically inject your real ip settings after the server { block opens:
run:
- replace:
filename: /etc/nginx/conf.d/discourse.conf
from: /server.+{/
to: |
server {
set_real_ip_from 192.168.1.100; ## Replace with your actual load balancer ip/subnet
real_ip_header X-Forwarded-For;
real_ip_recursive on;
(make sure indentation and spacing match the rest of run block, yml files are super strict)