[GH-ISSUE #1296] 502 Bad Gateway #1041

Closed
opened 2026-02-26 06:35:31 +03:00 by kerem · 4 comments
Owner

Originally created by @jpombas on GitHub (Aug 7, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1296

Hi,

I apologize for opening an issue, but I thought it was the best way to report the following problem:

I followed the steps for a quick setup, but apparently it wasn't successful, could you helpme to understand what's wrong?

Thanks for your help ;)

image

image

image

image

image

Originally created by @jpombas on GitHub (Aug 7, 2021). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1296 Hi, I apologize for opening an issue, but I thought it was the best way to report the following problem: I followed the steps for a quick setup, but apparently it wasn't successful, could you helpme to understand what's wrong? Thanks for your help ;) ![image](https://user-images.githubusercontent.com/9874020/128607921-bf114d82-4915-4b97-aeb3-3224f624423a.png) ![image](https://user-images.githubusercontent.com/9874020/128607802-d0fd9f64-9358-4e66-9198-341f7b7ab37c.png) ![image](https://user-images.githubusercontent.com/9874020/128607891-67eb7796-91f6-4c88-8581-bf298ccd6c71.png) ![image](https://user-images.githubusercontent.com/9874020/128607954-db137282-89f9-4990-acd3-a311e650b2f8.png) ![image](https://user-images.githubusercontent.com/9874020/128607826-8e7f715e-d0c0-4bdc-bd9b-fb115c91bc7d.png)
kerem closed this issue 2026-02-26 06:35:31 +03:00
Author
Owner

@jc21 commented on GitHub (Aug 8, 2021):

perhaps the nginx instance doesn't know what hassio is in the dns. Try curling it directly from within the running container:

docker exec -ti name_of_npm_container curl http://hassio:8123

you may have to use an ip address if the dns server on your network doesn't have an entry for hassio

<!-- gh-comment-id:894725882 --> @jc21 commented on GitHub (Aug 8, 2021): perhaps the nginx instance doesn't know what `hassio` is in the dns. Try curling it directly from within the running container: ``` docker exec -ti name_of_npm_container curl http://hassio:8123 ``` you may have to use an ip address if the dns server on your network doesn't have an entry for `hassio`
Author
Owner

@jpombas commented on GitHub (Aug 8, 2021):

Trying curl hassio:

image

Using local IP address, i got que following results:

image

image

image

I also added the following configuration in Hassio:

http:
use_x_forwarded_for: true
trusted_proxies:
- 127.0.0.1

<!-- gh-comment-id:894769901 --> @jpombas commented on GitHub (Aug 8, 2021): Trying curl hassio: ![image](https://user-images.githubusercontent.com/9874020/128627628-5dccc218-3bb2-4c55-9d29-2d33b5a8ff26.png) Using local IP address, i got que following results: ![image](https://user-images.githubusercontent.com/9874020/128627447-40ad4a08-e713-4b5e-8d27-ac4751e37825.png) ![image](https://user-images.githubusercontent.com/9874020/128627455-cd5848eb-bb99-4eec-b959-512e4bdec3c5.png) ![image](https://user-images.githubusercontent.com/9874020/128627481-af35cb18-bf9e-4809-8949-adaec85fe17f.png) I also added the following configuration in Hassio: http: use_x_forwarded_for: true trusted_proxies: - 127.0.0.1
Author
Owner

@phantomski77 commented on GitHub (Aug 10, 2021):

Try NPM’s container IP address for your trusted_proxies setting in http integration, instead of localhost. Localhost within your Home Assistant instance is just the container’s own localhost, not host’s localhost, if it makes sense. It needs immediate upstream reverse proxy IP, which would be your NPM container IP.

<!-- gh-comment-id:895782978 --> @phantomski77 commented on GitHub (Aug 10, 2021): Try NPM’s container IP address for your `trusted_proxies` setting in `http` integration, instead of localhost. Localhost within your Home Assistant instance is just the container’s own localhost, not host’s localhost, if it makes sense. It needs immediate upstream reverse proxy IP, which would be your NPM container IP.
Author
Owner

@jpombas commented on GitHub (Aug 10, 2021):

Problem solved, thank you guys.

Sorry, but It was my lack of experience 😉

<!-- gh-comment-id:895836272 --> @jpombas commented on GitHub (Aug 10, 2021): Problem solved, thank you guys. Sorry, but It was my lack of experience 😉
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#1041
No description provided.