Netbox dual hostnames in HTTP Headers + The domain name provided is not valid according to RFC 1034/1035 #3770

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

Originally created by @briantownjr on GitHub (Jun 11, 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

  1. https://netbox.readthedocs.io/en/stable/installation/3-netbox/
    2)Following all steps up to HTTP Daemon.
    3)Copied apache.conf out of /opt/netbox/contrib/apache.conf to sites-enabled
    4)Apache configuration on reverse proxy
<Location>            
ProxyPass https://gsdsp-netbox.spocc.gsfc.nasa.gov/netbox
ProxyPassReverse https://gsdsp-netbox.spocc.gsfc.nasa.gov/netbox
</Location>

5)Configuration.py baseurl set to "netbox/"
6)Running server via manage.py at 0.0.0.0:8001
7)Tested on localhost and direction connection via 192.168.1.5/netbox and works
8)Debug enabled on configuration.py :

Expected Behavior.
Expected the http header to contain a single hostname within after the proxy pass.

Observed behavior
Manage.py output:

Proxy Connection returns "GET /netbox HTTP/1.1" 400

Invalid HTTP_HOST header: '192.168.1.6, 192.168.1.5'. The domain name provided is not valid according to RFC 1034/1035

Request Method: | GET
-- | --
https://192.168.1.6, 192.168.1.5/netbox
3.0.7
DisallowedHost
Invalid HTTP_HOST header: '192.168.1.6, 192.168.1.5'. The domain name provided is not valid according to RFC 1034/1035.
/usr/local/lib/python3.6/dist-packages/django/http/request.py in get_host, line 122
/usr/bin/python3
3.6.9
['/opt/netbox-2.8.5/netbox',  '/usr/lib/python36.zip',  '/usr/lib/python3.6',  '/usr/lib/python3.6/lib-dynload',  '/usr/local/lib/python3.6/dist-packages',  '/usr/lib/python3/dist-packages']
Thu, 11 Jun 2020 02:25:52 +0000
Originally created by @briantownjr on GitHub (Jun 11, 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 1) https://netbox.readthedocs.io/en/stable/installation/3-netbox/ 2)Following all steps up to HTTP Daemon. 3)Copied apache.conf out of /opt/netbox/contrib/apache.conf to sites-enabled 4)Apache configuration on reverse proxy ``` <Location> ProxyPass https://gsdsp-netbox.spocc.gsfc.nasa.gov/netbox ProxyPassReverse https://gsdsp-netbox.spocc.gsfc.nasa.gov/netbox </Location> ``` 5)Configuration.py baseurl set to "netbox/" 6)Running server via manage.py at 0.0.0.0:8001 7)Tested on localhost and direction connection via 192.168.1.5/netbox and works 8)Debug enabled on configuration.py : Expected Behavior. Expected the http header to contain a single hostname within after the proxy pass. Observed behavior Manage.py output: `Proxy Connection returns "GET /netbox HTTP/1.1" 400` Invalid HTTP_HOST header: '192.168.1.6, 192.168.1.5'. The domain name provided is not valid according to RFC 1034/1035 ``` Request Method: | GET -- | -- https://192.168.1.6, 192.168.1.5/netbox 3.0.7 DisallowedHost Invalid HTTP_HOST header: '192.168.1.6, 192.168.1.5'. The domain name provided is not valid according to RFC 1034/1035. /usr/local/lib/python3.6/dist-packages/django/http/request.py in get_host, line 122 /usr/bin/python3 3.6.9 ['/opt/netbox-2.8.5/netbox', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages'] Thu, 11 Jun 2020 02:25:52 +0000 ```
adam closed this issue 2025-12-29 18:31:08 +01:00
Author
Owner

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

As indicated by my comment on #4741, this is a configuration issue, not a bug. I will ask you again to please post to the mailing list instead for assistance with your installation.

@jeremystretch commented on GitHub (Jun 11, 2020): As indicated by my comment on #4741, this is a configuration issue, not a bug. I will ask you again to please post to the [mailing list](https://groups.google.com/forum/#!forum/netbox-discuss) instead for assistance with your installation.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3770