netbox-chart icon indicating copy to clipboard operation
netbox-chart copied to clipboard

x_forwarded_for header

Open jsalatiel opened this issue 3 years ago • 9 comments

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!

jsalatiel avatar Apr 30 '21 18:04 jsalatiel

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

bootc avatar May 01 '21 21:05 bootc

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

jsalatiel avatar Sep 08 '21 16:09 jsalatiel

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.

bootc avatar Sep 09 '21 08:09 bootc

Understood. Thanks!

jsalatiel avatar Sep 09 '21 11:09 jsalatiel

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: https://github.com/netbox-community/netbox-docker/issues/654

bootc avatar Nov 27 '21 17:11 bootc

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

bootc avatar Apr 26 '22 19:04 bootc

Any news?

jsalatiel avatar Jul 15 '22 16:07 jsalatiel

We're almost there! The NetBox 3.2.6 container is now built from netbox-community/[email protected] 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.

bootc avatar Jul 17 '22 21:07 bootc

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

jsalatiel avatar Sep 24 '22 01:09 jsalatiel

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

RangerRick avatar May 10 '24 16:05 RangerRick

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/

bootc avatar May 11 '24 16:05 bootc