From cea731de161e1faaca844cc45e4ded78b0979a71 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 14 Jun 2021 14:23:11 -0400 Subject: [PATCH] Updated Common Issues (markdown) --- Common-Issues.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Common-Issues.md b/Common-Issues.md index c7a584f..bf441fd 100644 --- a/Common-Issues.md +++ b/Common-Issues.md @@ -1,6 +1,7 @@ * [ProgrammingError Exception Following a Recent Upgrade](#programmingerror-exception-following-a-recent-upgrade) * [502 Bad Gateway Error When Calling NAPALM API](#502-bad-gateway-error-when-calling-napalm-api) * [Rack Elevations Do Not Display](#rack-elevations-do-not-display-v27) +* [Rack Elevation Links use Wrong Domain](#rack-elevation-links-use-wrong-domain) ## ProgrammingError Exception Following a Recent Upgrade @@ -32,4 +33,16 @@ If the direct API call is successful but the images don't appear on the rack pag ### Recommended Solution -Inspect the configuration of your HTTP daemon (e.g. nginx or Apache) and remove any statements which statically set the `X-Frame-Options` header. \ No newline at end of file +Inspect the configuration of your HTTP daemon (e.g. nginx or Apache) and remove any statements which statically set the `X-Frame-Options` header. + +## Rack Elevation Links use Wrong Domain + +### What's Happening + +NetBox runs as a [WSGI application](https://en.wikipedia.org/wiki/Web_Server_Gateway_Interface) behind front-end HTTP server (e.g. Apache or nginx), which serves as a reverse proxy. Because NetBox doesn't have direct access to the raw HTTP request, it relies on the HTTP server to forward important details, such as the requested host and the HTTP protocol in use. If these details are not correctly forwarded to NetBox, NetBox will be unable to render absolute URLs (those which start with `https://`, as opposed to a relative URL). + +For most hyperlinks, NetBox uses relative links. However, in a few specific instances, such as when rendering rack elevations, NetBox must use absolute URLs. This is because the rack elevations are actually embedded SVG images: Since these images might also appear outside the NetBox UI, absolute URLs must be used. If the HTTP frontend has not been configured to correctly relay the necessary information about the incoming HTTP request, these links will use the IP address of the backend service rather than the requested host or IP address. + +### Recommended Solution + +This is a simple fix. Just ensure that your HTTP server is sending the `X-Forwarded-Proto` and `X-Forwarded-Host` HTTP headers on requests being proxied via WSGI. Example configurations for both [nginx](https://github.com/netbox-community/netbox/blob/master/contrib/nginx.conf) and [Apache](https://github.com/netbox-community/netbox/blob/master/contrib/apache.conf) are included for your reference. \ No newline at end of file