Netbox with external reverse proxy. #3766

Closed
opened 2025-12-29 18:31:07 +01:00 by adam · 1 comment
Owner

Originally created by @briantownjr on GitHub (Jun 10, 2020).

Environment

Python Version 3.6
Netbox version v2.8.5 - 2020-05-26
Netbox local instance at 192.168.1.5
Reverse proxy instance at 192.168.1.6

####Steps to reproduce
https://netbox.readthedocs.io/en/stable/installation/3-netbox/

Following all steps to HTTP Daemon.
Copied apache.conf out of /opt/netbox/contrib/apache.conf to sites-enabled
gunicorn.py set to run at 0.0.0.0:8001
Settings work properly via localhost

`<Directory /opt/netbox/netbox/static>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Require all granted

<Location /static>
    ProxyPass !
</Location>

RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
ProxyPass / http://192.168.1.5:8001/
ProxyPassReverse / http://192.168.1.5:8001/`

Modified settings on reverse proxy to be

<Location /netbox>
ProxyPass http://192.168.1.5:8001
ProxyPassReverse http://http://192.168.1.5:8001
</Location>

Modified base_url in /opt/netbox/netbox/netbox/configuration.py to include 'opt/netbox/netbox/static'

####Expected behavior
Reverse proxy at 192.168.1.6 proxying properly back to 192.168.1.5:8001 via 192.168.1.6/netbox location

####Observed behavior
"404 NOT FOUND: 192.168.5.5opt/netbox/netbox/static/media-failure/?filename=select2-bootstrap-0.1.0-beta.10/select2-bootstrap.min.css"

Modifying base_url to point to other locations has similar results

Originally created by @briantownjr on GitHub (Jun 10, 2020). ### Environment Python Version 3.6 Netbox version v2.8.5 - 2020-05-26 Netbox local instance at 192.168.1.5 Reverse proxy instance at 192.168.1.6 ####Steps to reproduce https://netbox.readthedocs.io/en/stable/installation/3-netbox/ Following all steps to HTTP Daemon. Copied apache.conf out of /opt/netbox/contrib/apache.conf to sites-enabled gunicorn.py set to run at 0.0.0.0:8001 Settings work properly via localhost `<Directory /opt/netbox/netbox/static> Options Indexes FollowSymLinks MultiViews AllowOverride None Require all granted </Directory> <Location /static> ProxyPass ! </Location> RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME} ProxyPass / http://192.168.1.5:8001/ ProxyPassReverse / http://192.168.1.5:8001/` Modified settings on reverse proxy to be ``` <Location /netbox> ProxyPass http://192.168.1.5:8001 ProxyPassReverse http://http://192.168.1.5:8001 </Location> ``` Modified base_url in /opt/netbox/netbox/netbox/configuration.py to include 'opt/netbox/netbox/static' ####Expected behavior Reverse proxy at 192.168.1.6 proxying properly back to 192.168.1.5:8001 via 192.168.1.6/netbox location ####Observed behavior "404 NOT FOUND: 192.168.5.5opt/netbox/netbox/static/media-failure/?filename=select2-bootstrap-0.1.0-beta.10/select2-bootstrap.min.css" Modifying base_url to point to other locations has similar results
adam closed this issue 2025-12-29 18:31:07 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jun 10, 2020):

Thank you for your interest in NetBox. GitHub issues are intended for reporting reproducible bugs and requesting features, and must be submitted using one of the templates provided here. For general discussion, questions, or assistance with installation issues, please post to our mailing list instead.

@jeremystretch commented on GitHub (Jun 10, 2020): Thank you for your interest in NetBox. GitHub issues are intended for reporting reproducible bugs and requesting features, and must be submitted using one of the templates provided [here](https://github.com/netbox-community/netbox/issues/new/choose). For general discussion, questions, or assistance with installation issues, please post to our [mailing list](https://groups.google.com/forum/#!forum/netbox-discuss) instead.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3766