mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-26 01:45:54 +03:00
[GH-ISSUE #3919] Proxy not forwarding to locally-hosted services #2568
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#2568
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @huntson on GitHub (Aug 8, 2024).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/3919
Checklist
jc21/nginx-proxy-manager:latestdocker image?Describe the bug
The Proxy Manager is currently running in a docker. I am unable to get it to forward to services locally hosted dockers the same system. All forwards to other systems work fine however when forwarding to local services in dockers. I've tried local docker IPs plus the port number as well as the local IP of the server plus the port number and no luck.
Nginx Proxy Manager Version
2.11.13
To Reproduce
Steps to reproduce the behavior:
See above. I receive a 504 Gateway Time-out.
Compose command:
Expected behavior
I'd expect the local service to be loaded.
Screenshots
Operating System
Docker running on QNAP
Additional context
@phulstaert commented on GitHub (Aug 8, 2024):
This is very limited information to help you with.
I can confirm that this is not a nginx-proxy-manager issue; since this use case works with my setup. I use it at multiple locations like this.
I would suggest to post the following information:
What QNAP NAS are you using and does it have multiple network interfaces that are bonded together? (I have a Synology NAS where bonded ethernet ports prevent docker containers to talk to each other) - this is not the case on a "simple" VM.
docker-compose (or command if you don't use docker compose) how the nginx-proxy-manager is set up. That way we can see what network it is connected to, what exposed ports there are, etc...
docker-compose (or command if you don't use docker compose) of the service you try to reach. Are they in the same network? (ex: a common reverse_proxy network?)
does the reverse proxy work on external (other machines) services - or only when they are on the same machine?
@huntson commented on GitHub (Aug 8, 2024):
I appreciate you sharing what additional information you need:
I am using a TS-h1887RP with one NIC being used.
In my original post I did have the docker-compose command however I'm not sure where it is. I have updated the original and will be pasting it here.
Here is the compose command of the service I am attempting to reach. As far as I understand/know, they are on their own networks.
As stated in the original, the reverse proxy works well on external services - only services on the same machine, specifically docker services on the same machine, are problematic.
@phulstaert commented on GitHub (Aug 8, 2024):
To be clear, I'm just a user, not a contributor of this application.
Have you checked this?
Have you tried if you can ping from one container to another? (ex: start an alpine image or something like that)
@huntson commented on GitHub (Aug 8, 2024):
Now we're getting somewhere. It appears there is a limited set of containers that cannot be reached via ping from my nginx proxy container. That being said everything is set to allow so I'm a bit at a loss as to how this has happened. While I realize container support is not what I'm here for, any thoughts would be helpful.
@phulstaert commented on GitHub (Aug 8, 2024):
It is good that there are both containers that are reachable and containers that are not reachable. This gives us something to compare. I'm also no expert in these kind of things, but hey, maybe we find something together :-)
Personally I would do the following:
@huntson commented on GitHub (Aug 9, 2024):
I was able to add a second interface to both containers which got them talking to each other. Oddly enough I have another issue now. Generally speaking, if I go to the ip:port of the server, it auto-redirects to ip:port/auth/login?redirectAfterLogin=/board. When going to the FQDN of the proxy it redirects to FQDN/redirect.html?count=0.38129492248640207. Not sure why that is.
What is the best way of having fqdn.com redirect to fqdn.com/board OR proxy to ip:port/board?
@phulstaert commented on GitHub (Aug 9, 2024):
This is far beyond nginx-proxy-manager, but i'll give a general idea how this works and what could be the culprit.
When you go to a website, the server will get the request and for example notice you are not logged in.
It will not react with a content and a HTTP 200 code, but with a redirect (HTTP 302 or HTTP 303 - it should be 303 but a lot of software uses 302; but this does not really matter since they both "do" the same) to a certain page. (often BASE_URL/login). This is however something the application itself does.
When on the login page, you enter your credentials and if they are wrong, you stay on the same page (with an error); if they are correct a SID cookie is set and you are redirected (again HTTP 302/303) to the main page. Now the main page sees that you are logged in, so it will present you with the main page and will not do a redirect to the login page.
In your case, the application does something that you do not expect.
Although you CAN configure redirects in nginx-proxy-manager, this is more suited for a 301 (permanently moved) or a valid 302 (Found) use case. (ex: if you go to "https://support.company.xyz", you get redirected to "https://jira.company.xyz/tickets/new?type=guest").
Nginx is not suited to do any checking of passwords to see if you can log in or not. This is up to the application itself.
Does this makes sence to you? My explanation is a bit long, so maybe not that good :-D
@huntson commented on GitHub (Aug 9, 2024):
I wholeheartedly disagree that this is beyond nginx-proxy-manager. It's quite possible I posed this incorrectly however when using the reverse proxy manager built into my NAS, supposedly based on Squid, fqdn redirects to ip:port for this container and the service loads properly.
interestingly enough things seem to be working today so I'll have to do more research using some of the techniques that you mentioned in order to figure this out.
@phulstaert commented on GitHub (Aug 9, 2024):
I might have been a bit unclear too. When you see the new url, NPM passes it trough. As I understand, you see a redirect url, so this is happing correctly.
What I mean is that it is not up to NPM to decide what url to forward to. That is a function of the application.
An analogy would be "the postal service has nothing to do with what is IN a letter". They are just the messenger.
NPM is a messenger and it passes through a message coming from an application. Even a redirect is in essence "just a message".
@huntson commented on GitHub (Aug 14, 2024):
Nonetheless, is there a way to do a 'slash' redirect? For example, I want this to proxy service.domain.com to :port/bob.
@github-actions[bot] commented on GitHub (Feb 14, 2025):
Issue is now considered stale. If you want to keep it open, please comment 👍