Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x_forwarded_for header #46

Open
jsalatiel opened this issue Apr 30, 2021 · 11 comments
Open

x_forwarded_for header #46

jsalatiel opened this issue Apr 30, 2021 · 11 comments
Labels
more info More information required from the reporter upstream The problem is in an upstream project

Comments

@jsalatiel
Copy link

Hi bootc , thanks for this helm chart, it works great!

I have a question, though. If I remind correctly, old versions of netbox used to have nginx as a requirement for serving static content, but in this chart I have absolutely no idea how the content is served. I only see some unitd processes:

PID   USER     TIME  COMMAND
    1 1000      0:00 {unitd} unit: main v1.22.0 [unitd --no-daemon --control unix:/opt/unit/unit.sock --pid /opt/unit/unit.pid --log /dev/stdout --state /opt/unit/state/ --tmp /opt/unit/tmp/]
   15 1000      0:00 {unitd} unit: controller
   16 1000      0:00 {unitd} unit: router
   20 1000      0:04 {unitd} unit: "netbox" application
   46 1000      0:05 {unitd} unit: "netbox" application
   48 1000      0:05 {unitd} unit: "netbox" application

Anyways, my question is : Is there anyway to make the real client IP appears in the log files for this chart ?
In plain nginx I could just set some parameters and it would work. On this chart I have no idea how to make it work.

Thanks!

@bootc bootc added enhancement New feature or request upstream The problem is in an upstream project labels May 1, 2021
@bootc
Copy link
Member

bootc commented May 1, 2021

This is a limitation of netbox-docker, which now uses NGINX Unit. It looks like support for this is simply missing from NGINX Unit: nginx/unit#132. Sorry.

@jsalatiel
Copy link
Author

@bootc Will you update to unit 1.25 to allow this ?

@bootc
Copy link
Member

bootc commented Sep 9, 2021

This needs to be fixed in netbox-docker, not in this chart, so you'd need to ask there. As of the quay.io/netboxcommunity/netbox:v3.0.2 image this includes Unit 1.23. It looks like the netbox-docker project just pulls Unit from Alpine, so we'll likely need to wait for Alpine 3.15 and then a netbox-docker release that updates the Alpine base image.

@jsalatiel
Copy link
Author

Understood. Thanks!

@bootc
Copy link
Member

bootc commented Nov 27, 2021

I've created an issue (in netbox-docker) to update the NetBox Docker image with Alpine 3.15 (released earlier this week) which contains Unit 1.26: netbox-community/netbox-docker#654

@bootc
Copy link
Member

bootc commented Apr 26, 2022

NetBox 3.2.1 still appears to use Alpine 3.14, so this still isn't fixed.

@jsalatiel
Copy link
Author

Any news?

@bootc
Copy link
Member

bootc commented Jul 17, 2022

We're almost there! The NetBox 3.2.6 container is now built from netbox-community/netbox-docker@2.0.0 and includes NGINX Unit 1.27.0.

In theory you should be able to pass a modified version of /etc/unit/nginx-unit.json which enables the functionality on the listener. I haven't yet tried this.

@jsalatiel
Copy link
Author

I haven't been able to make it work :(

@RangerRick
Copy link
Contributor

It looks like the current docker images are up to unit 1.32, is this still an issue?

@RangerRick RangerRick added more info More information required from the reporter and removed enhancement New feature or request labels May 10, 2024
@bootc
Copy link
Member

bootc commented May 11, 2024

I haven't tested this, but it should be OK with recent NetBox and the 5.0 chart, but you'll need to override the NGINX Unit configuration in the chart to include the necessary runes to enable it.

https://unit.nginx.org/configuration/#ip-protocol-forwarding
https://unit.nginx.org/news/2021/unit-1.25.0-released/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info More information required from the reporter upstream The problem is in an upstream project
Projects
None yet
Development

No branches or pull requests

3 participants