Absolute URLs for devices shown in rack overview rather than relative URLs #5660

Closed
opened 2025-12-29 19:30:47 +01:00 by adam · 2 comments
Owner

Originally created by @pgnuta on GitHub (Nov 14, 2021).

NetBox version

v3.0.10

Python version

3.9

Steps to Reproduce

  1. Navigate to any existing rack with devices mounted at /dcim/racks/{rack id}/
  2. Inspect the URL of any device shown in the rack overview, it will contain the full host name and port rather than just the relative URL path

This behaviour is not only inconsistent with the URL writing of the rest of the netbox interface (As far as i can find) but it also messes up reverse proxies where html body rewrite is not enabled such as Azure Application Proxy.

Expected Behavior

URLs of devices should be relative and not contain the full hostname and port.

Observed Behavior

URLs of devices have full hostname and port.

Originally created by @pgnuta on GitHub (Nov 14, 2021). ### NetBox version v3.0.10 ### Python version 3.9 ### Steps to Reproduce 1. Navigate to any existing rack with devices mounted at /dcim/racks/{rack id}/ 2. Inspect the URL of any device shown in the rack overview, it will contain the full host name and port rather than just the relative URL path This behaviour is not only inconsistent with the URL writing of the rest of the netbox interface (As far as i can find) but it also messes up reverse proxies where html body rewrite is not enabled such as Azure Application Proxy. ### Expected Behavior URLs of devices should be relative and not contain the full hostname and port. ### Observed Behavior URLs of devices have full hostname and port.
adam closed this issue 2025-12-29 19:30:47 +01:00
Author
Owner

@kkthxbye-code commented on GitHub (Nov 15, 2021):

The reasoning for using full paths can be found here:

https://github.com/netbox-community/netbox/issues/4147

Implemented here:

721368ea8d (diff-c8b870546bd2d5cc8da27ba39318b96a4ca0fb6172e9d9beb0aab177410bf848)

I guess we could add a new parameter to RackElevationDetailFilterSerializer to allow the user to request relative or full paths in the svg and then just change the rack_elevation.html template.

@kkthxbye-code commented on GitHub (Nov 15, 2021): The reasoning for using full paths can be found here: https://github.com/netbox-community/netbox/issues/4147 Implemented here: https://github.com/netbox-community/netbox/commit/721368ea8d095b3882fc31d1f88637ae696a204b#diff-c8b870546bd2d5cc8da27ba39318b96a4ca0fb6172e9d9beb0aab177410bf848 I guess we could add a new parameter to RackElevationDetailFilterSerializer to allow the user to request relative or full paths in the svg and then just change the rack_elevation.html template.
Author
Owner

@jeremystretch commented on GitHub (Nov 15, 2021):

This behavior is both intentional and necessary, as the SVG images are intended to be usable as standalone documents. An incorrect URL indicates that your HTTP reverse proxy is incorrectly configured. Please see this wiki article for tips on correcting it.

@jeremystretch commented on GitHub (Nov 15, 2021): This behavior is both intentional and necessary, as the SVG images are intended to be usable as standalone documents. An incorrect URL indicates that your HTTP reverse proxy is incorrectly configured. Please see [this wiki article](https://github.com/netbox-community/netbox/wiki/Common-Issues#rack-elevation-links-use-wrong-domain) for tips on correcting it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5660