[GH-ISSUE #310] Add instructions for updating nginx config with haproxy #340

Closed
opened 2026-03-14 07:46:56 +03:00 by kerem · 2 comments
Owner

Originally created by @SimpleTechGuy on GitHub (Jul 6, 2025).
Original GitHub issue: https://github.com/amidaware/trmm-docs/issues/310

The current haproxy instructions mention how to add x-forwarded-for header, however, it doesn't appear to work unless you manually edit the nginx files on the trmm server.

Need to add instructions for how to edit the nginx conf file to accept x-forwarded-for headers.

I have created a fork and made the changes, but I've never done a pull request before so posting here first. Please let me know if you would like for me to create the pull request, otherwise, it should be easy enough to add the following to the haproxy section (or possibly this may need to be at the top of unsupported proxies as I think it will affect all proxies). Currently a similar option is already mentioned in the section for Apache Proxy, however, since it is not in the haproxy section it could be mistakenly assumed that it is not needed for haproxy..:

### NGINX ADJUSTMENTS

You will need to edit the nginx.conf file in the http section on the trmm server to recognize the X-Forwarded-For Header that will be sent from haproxy:

Edit file /etc/nginx/nginx.conf
Add the lines from 'real_ip' module inside server tag:

conf
set_real_ip_from    192.168.0.200; #IP Address of your haproxy server
real_ip_header      X-Forwarded-For;


Restart nginx:

bash
systemctl restart nginx.service

Originally created by @SimpleTechGuy on GitHub (Jul 6, 2025). Original GitHub issue: https://github.com/amidaware/trmm-docs/issues/310 The current haproxy instructions mention how to add x-forwarded-for header, however, it doesn't appear to work unless you manually edit the nginx files on the trmm server. Need to add instructions for how to edit the nginx conf file to accept x-forwarded-for headers. I have created a fork and made the changes, but I've never done a pull request before so posting here first. Please let me know if you would like for me to create the pull request, otherwise, it should be easy enough to add the following to the haproxy section (or possibly this may need to be at the top of unsupported proxies as I think it will affect all proxies). Currently a similar option is already mentioned in the section for Apache Proxy, however, since it is not in the haproxy section it could be mistakenly assumed that it is not needed for haproxy..: ``` ### NGINX ADJUSTMENTS You will need to edit the nginx.conf file in the http section on the trmm server to recognize the X-Forwarded-For Header that will be sent from haproxy: Edit file /etc/nginx/nginx.conf Add the lines from 'real_ip' module inside server tag: conf set_real_ip_from 192.168.0.200; #IP Address of your haproxy server real_ip_header X-Forwarded-For; Restart nginx: bash systemctl restart nginx.service ```
kerem closed this issue 2026-03-14 07:47:01 +03:00
Author
Owner

@SimpleTechGuy commented on GitHub (Jul 7, 2025):

Created the PR here: #311

<!-- gh-comment-id:3043186907 --> @SimpleTechGuy commented on GitHub (Jul 7, 2025): Created the PR here: #311
Author
Owner

@SimpleTechGuy commented on GitHub (Jul 7, 2025):

Excellent! PR complete! Thank you #311

<!-- gh-comment-id:3043272694 --> @SimpleTechGuy commented on GitHub (Jul 7, 2025): Excellent! PR complete! Thank you #311
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/trmm-docs#340
No description provided.