[PR #2068] [CLOSED] Pass the actual Host header as X-Forwarded-Host in nginx config, use device.display_name property in rack elevation template #12303

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/2068
Author: @nickzxcv
Created: 4/28/2018
Status: Closed

Base: developHead: develop


📝 Commits (2)

  • 8685feb Pass the actual Host header as X-Forwarded-Host in nginx config
  • d152dd3 change rack elevation template to use device.display_name property

📊 Changes

2 files changed (+2 additions, -2 deletions)

View changed files

📝 docs/installation/web-server.md (+1 -1)
📝 netbox/templates/dcim/inc/rack_elevation.html (+1 -1)

📄 Description

Fixes:

  1. Nginx config in docs
    The sample nginx config in the installation documents passes the $server_name value in the X-Forwarded-Host header instead of the actual Host header value in the request. A response containing an absolute URL can have a different domain name than was in the original request, which might not match an SSL certificate, preventing further requests.
    If value of the Host header is used to generate the absolute URLs (also as mentioned in https://github.com/digitalocean/netbox/issues/1184 ) then originally requested domain name will continue in the responses and continue working with SSL certificates. The $host variable in the nginx configuration http://nginx.org/en/docs/http/ngx_http_core_module.html#var_host can fall back to $server_name in case Host isn't set, so this should still work as before in some cases.

  2. Device names in rack elevations
    In rack elevations, the device name will show, or in case of unnamed devices it will show the device type. In case an unnamed device is a member of a virtual chassis though, it should show the name of the master member. This logic is part of the device.display_name property in the model, but before this change the rack elevation template doesn't use that property and does a similar logic except for the virtual chassis handling.


🔄 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/2068 **Author:** [@nickzxcv](https://github.com/nickzxcv) **Created:** 4/28/2018 **Status:** ❌ Closed **Base:** `develop` ← **Head:** `develop` --- ### 📝 Commits (2) - [`8685feb`](https://github.com/netbox-community/netbox/commit/8685feb4b7fe1d373c1f9f47c57c4405ce64d3af) Pass the actual Host header as X-Forwarded-Host in nginx config - [`d152dd3`](https://github.com/netbox-community/netbox/commit/d152dd38651e8f3803d9d2e84ef3dc69d406a736) change rack elevation template to use device.display_name property ### 📊 Changes **2 files changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `docs/installation/web-server.md` (+1 -1) 📝 `netbox/templates/dcim/inc/rack_elevation.html` (+1 -1) </details> ### 📄 Description <!-- 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: 1. Nginx config in docs The sample nginx config in the installation documents passes the $server_name value in the X-Forwarded-Host header instead of the actual Host header value in the request. A response containing an absolute URL can have a different domain name than was in the original request, which might not match an SSL certificate, preventing further requests. If value of the Host header is used to generate the absolute URLs (also as mentioned in https://github.com/digitalocean/netbox/issues/1184 ) then originally requested domain name will continue in the responses and continue working with SSL certificates. The $host variable in the nginx configuration http://nginx.org/en/docs/http/ngx_http_core_module.html#var_host can fall back to $server_name in case Host isn't set, so this should still work as before in some cases. 2. Device names in rack elevations In rack elevations, the device name will show, or in case of unnamed devices it will show the device type. In case an unnamed device is a member of a virtual chassis though, it should show the name of the master member. This logic is part of the device.display_name property in the model, but before this change the rack elevation template doesn't use that property and does a similar logic except for the virtual chassis handling. --- <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:46 +01:00
adam closed this issue 2025-12-29 22:20:46 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12303