Add USE_X_FORWARDED_HOST to configuration #11428

Closed
opened 2025-12-29 21:45:08 +01:00 by adam · 2 comments
Owner

Originally created by @llamafilm on GitHub (Jul 30, 2025).

NetBox version

v4.3.2

Feature type

Change to existing functionality

Proposed functionality

I would like to be able to set USE_X_FORWARDED_HOST in configuration.py. Currently the default value is set to True in settings.py and it cannot be overridden by configuration.py.

Use case

My reverse proxy sets this header to the FQDN with no port number, and it puts the correct FQDN + port in the Host header. So when I make API calls with a custom port number, the API response includes incorrect URLs. If I set USE_X_FORWARDED_HOST=False in settings.py then everything works. But I would prefer not to modify that file.

Database changes

No response

External dependencies

No response

Originally created by @llamafilm on GitHub (Jul 30, 2025). ### NetBox version v4.3.2 ### Feature type Change to existing functionality ### Proposed functionality I would like to be able to set USE_X_FORWARDED_HOST in configuration.py. Currently the default value is set to True in settings.py and it cannot be overridden by configuration.py. ### Use case My reverse proxy sets this header to the FQDN with no port number, and it puts the correct FQDN + port in the Host header. So when I make API calls with a custom port number, the API response includes incorrect URLs. If I set `USE_X_FORWARDED_HOST=False` in settings.py then everything works. But I would prefer not to modify that file. ### Database changes _No response_ ### External dependencies _No response_
adam added the type: featurestatus: under review labels 2025-12-29 21:45:08 +01:00
adam closed this issue 2025-12-29 21:45:08 +01:00
Author
Owner

@llamafilm commented on GitHub (Jul 30, 2025):

I would be happy to make a PR for this.

@llamafilm commented on GitHub (Jul 30, 2025): I would be happy to make a PR for this.
Author
Owner

@arthanson commented on GitHub (Jul 31, 2025):

You can either change this at your proxy or you can change it in local_settings if needed. We've opted not to expose this as a configuration item.

@arthanson commented on GitHub (Jul 31, 2025): You can either change this at your proxy or you can change it in local_settings if needed. We've opted not to expose this as a configuration item.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11428