Invalid IP error when login attempt fails, and netbox is behind reverse proxy (haproxy) #9355

Closed
opened 2025-12-29 20:48:57 +01:00 by adam · 0 comments
Owner

Originally created by @pelinche on GitHub (Mar 14, 2024).

Deployment Type

Self-hosted

NetBox Version

v3.7.4

Python Version

3.11

Steps to Reproduce

I'm running netbox using a docker image, and netbox is running behind a reverse proxy (haproxy). When the user tries do login on netbox, system give this error.

image

If password is correct, system works correctly and allow user to use system.

When i try to open netbox without reverse proxy, system gives me the right error message.

image

I tried a solution, changing the order to resolve IP Address (f563ba7a9e/netbox/utilities/request.py (L8)), and this solved for me.

image

Expected Behavior

image

Observed Behavior

image

Originally created by @pelinche on GitHub (Mar 14, 2024). ### Deployment Type Self-hosted ### NetBox Version v3.7.4 ### Python Version 3.11 ### Steps to Reproduce I'm running netbox using a docker image, and netbox is running behind a reverse proxy (haproxy). When the user tries do login on netbox, system give this error. ![image](https://github.com/netbox-community/netbox/assets/71408972/ad2e3b94-7f4f-4b6c-b424-3d58d64568ae) If password is correct, system works correctly and allow user to use system. When i try to open netbox without reverse proxy, system gives me the right error message. ![image](https://github.com/netbox-community/netbox/assets/71408972/fbeed7e2-7ed0-477c-a1e0-2721dd041875) I tried a solution, changing the order to resolve IP Address (https://github.com/netbox-community/netbox/blob/f563ba7a9e04af6e985a8f24bf8a3ad66fce168b/netbox/utilities/request.py#L8), and this solved for me. ![image](https://github.com/netbox-community/netbox/assets/71408972/adc8ab3a-d8bf-4fa7-9b43-c29a0174118e) ### Expected Behavior ![image](https://github.com/netbox-community/netbox/assets/71408972/0b7d77ae-9071-4ebd-b453-c92b5c35dc62) ### Observed Behavior ![image](https://github.com/netbox-community/netbox/assets/71408972/ee1e0460-509b-464a-bb4d-0a2fd48a45a2)
adam closed this issue 2025-12-29 20:48:57 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9355