device links in rack (elevation) view point to localhost:8085

156 views
Skip to first unread message

Noel Leistad

unread,
Jul 27, 2020, 3:31:34 PM7/27/20
to NetBox
A borked upgrade forced me to re-install. (It's good practice). Only had a minor amount of data loaded and could stand to do things better.

On previous version, clicking device links in rack view (elevation), pointed at {host}/dcim/devcies/nn/  I must have messed up the config on re-install because now links point to localhost:8085/dcim/devices/nn/

If I manually change "localhost:8085" to "netbox.domain.tld" ahead of /dcim/devices/.... it proceeds to the device page. 

Looks like it should be /opt/netbox/gunicorn.py setting but changing upsets nginx and "bad gateway" results. 

I've searched the forum for "localhost" "link" "elevation" but it looks like I've created a original mess. If I could get pointed in the right direction, that would be great.

Thanks
 


Brian Candler

unread,
Jul 27, 2020, 4:28:44 PM7/27/20
to NetBox
If it were Apache you would need "ProxyPreserveHost on". I don't know what the nginx equivalent setting is, but carefully check the difference between your proxy config and the sample configs.

noel.l...@gmail.com

unread,
Jul 28, 2020, 3:25:19 PM7/28/20
to NetBox
Less of an nginx person that I should be. COULD learn more, but a change made it work and I thought I'd explain what I did for posterity....

in the nginx/site-available/netbox.conf the section 
    location / {
        proxy_pass http://localhost:8085;
## I added the following w/o commenting out the preceding and the "rack" links populated with "FDQN"/dcim/devices/"nn"/ rather than http://localhost:8085/dcim/devices/"nn"/
        proxy_set_header Host $host;
    }

Thanks for the help. I'm slightly ashamed for not traveling down the rabbit-hole of nginx configs but this made it work for me and fleshing out netbox is way higher on my priority list..

Noel

Brian Candler

unread,
Jul 29, 2020, 3:00:24 AM7/29/20
to NetBox
Glad it's working.

Maybe it would have worked with the sample nginx.conf which sets X-Forwarded-Host:


Reply all
Reply to author
Forward
0 new messages