When I go to /dcim/racks/<N>/ and hover over a device, I see the correct https://<fqdn>/dcim/devices/<id>/ URL.
Looking at the code:
def _draw_device_front(self, drawing, device, start, end, text):
name = str(device)
if device.devicebay_count:
name += ' ({}/{})'.format(device.get_children().count(), device.devicebay_count)
color = device.device_role.color
link = drawing.add(
drawing.a(
href='{}{}'.format(self.base_url, reverse('dcim:device', kwargs={'pk': device.pk})), target='_top',
fill='black'
)
)
And where does base_url come from?
if data['render'] == 'svg':
# Render and return the elevation as an SVG drawing with the correct content type
drawing = rack.get_elevation_svg(
face=data['face'],
unit_width=data['unit_width'],
unit_height=data['unit_height'],
legend_width=data['legend_width'],
include_images=data['include_images'],
base_url=request.build_absolute_uri('/')
)
So, it comes from the request. Are you sure that your proxy configuration is passing through the hostname unmolested? In Apache I use:
ProxyPreserveHost On
Without it, the Host: header is set to the proxy target host, not the incoming HTTP host. If that's the problem, the solution for Nginx is here: