[PR #1969] [CLOSED] Use relative paths #12290

Closed
opened 2025-12-29 22:20:41 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/1969
Author: @logan2211
Created: 3/15/2018
Status: Closed

Base: developHead: relative-paths


📝 Commits (1)

📊 Changes

4 files changed (+6 additions, -6 deletions)

View changed files

📝 netbox/netbox/settings.py (+3 -3)
📝 netbox/templates/_base.html (+1 -1)
📝 netbox/templates/rest_framework/api.html (+1 -1)
📝 netbox/utilities/forms.py (+1 -1)

📄 Description

Relative paths are helpful when running netbox behind a load balancer
where the client's path may not match what the server receives.

BASE_PATH can still be used to mimic the current behavior by setting:
BASE_PATH = '/'

Fixes:

Situation where the client is loading ex. /netbox but the netbox app is not aware it is behind a LB, and instead is serving from /. The LB in this case is responsible for path stripping the /netbox to /, but due to how netbox serves the requests it will link all of the static content using / which is not valid.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/1969 **Author:** [@logan2211](https://github.com/logan2211) **Created:** 3/15/2018 **Status:** ❌ Closed **Base:** `develop` ← **Head:** `relative-paths` --- ### 📝 Commits (1) - [`e23a785`](https://github.com/netbox-community/netbox/commit/e23a785a14f1bcb3194f86cc45e9d9f7b71ad91e) Use relative paths ### 📊 Changes **4 files changed** (+6 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `netbox/netbox/settings.py` (+3 -3) 📝 `netbox/templates/_base.html` (+1 -1) 📝 `netbox/templates/rest_framework/api.html` (+1 -1) 📝 `netbox/utilities/forms.py` (+1 -1) </details> ### 📄 Description Relative paths are helpful when running netbox behind a load balancer where the client's path may not match what the server receives. BASE_PATH can still be used to mimic the current behavior by setting: BASE_PATH = '/' <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be opened for approval prior to filing a pull request. This helps avoid wasting time and effort on something that we might not be able to accept. Please indicate the relevant feature request or bug report below. --> ### Fixes: Situation where the client is loading ex. /netbox but the netbox app is not aware it is behind a LB, and instead is serving from /. The LB in this case is responsible for path stripping the /netbox to /, but due to how netbox serves the requests it will link all of the static content using / which is not valid. <!-- Please include a summary of the proposed changes below. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 22:20:41 +01:00
adam closed this issue 2025-12-29 22:20:41 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12290