[GH-ISSUE #2594] Issue - serve a host as subpage from another host [ Two servers in single host ] #1807

Closed
opened 2026-02-26 07:32:32 +03:00 by kerem · 5 comments
Owner

Originally created by @redtripleAAA on GitHub (Feb 7, 2023).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2594

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you're not using someone else's docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug

Issue - server a host as subpage from another host

Nginx Proxy Manager Version

v2.9.19

To Reproduce
Steps to reproduce the behavior:

You have two servers:
SERVER ONE >> https://serverone.com
SERVER TWO >> http://10.0.12.201:8134

SERVER ONE works fine, and I have a host record working from npm.

Now, I want to serve the SERVER TWO as part of SERVER ONE, for example, when I type URL
https://serverone.com/servertwo

Any idea what would be the issue here?

Reason doing this setup:
To server both servers in a single domain, that helps avoid CORS issues as well.

Expected behavior

To load server two into the subpage from server one as mentioned above

Screenshots

Screenshot 2023-02-07 at 1 47 42 PM

Screenshot 2023-02-07 at 1 47 04 PM

Note: I tried to use Locations setup from SERVER ONE, and point a subpage as location SERVER TWO.
However, it seems npm recognizes the input, still it shows error 404 Not Found

Operating System

Docker npm
Synolog DSM

Additional context

Originally created by @redtripleAAA on GitHub (Feb 7, 2023). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2594 <!-- Are you in the right place? - If you are looking for support on how to get your upstream server forwarding, please consider asking the community on Reddit. - If you are writing code changes to contribute and need to ask about the internals of the software, Gitter is the best place to ask. - If you think you found a bug with NPM (not Nginx, or your upstream server or MySql) then you are in the *right place.* --> **Checklist** - Have you pulled and found the error with `jc21/nginx-proxy-manager:latest` docker image? - Yes - Are you sure you're not using someone else's docker image? - Yes - Have you searched for similar issues (both open and closed)? - Yes **Describe the bug** <!-- A clear and concise description of what the bug is. --> Issue - server a host as subpage from another host **Nginx Proxy Manager Version** <!-- What version of Nginx Proxy Manager is reported on the login page? --> v2.9.19 **To Reproduce** Steps to reproduce the behavior: You have two servers: SERVER ONE >> https://serverone.com SERVER TWO >> http://10.0.12.201:8134 SERVER ONE works fine, and I have a host record working from npm. Now, I want to serve the SERVER TWO as part of SERVER ONE, for example, when I type URL https://serverone.com/servertwo Any idea what would be the issue here? Reason doing this setup: To server both servers in a single domain, that helps avoid CORS issues as well. **Expected behavior** <!-- A clear and concise description of what you expected to happen. --> To load server two into the subpage from server one as mentioned above **Screenshots** <!-- If applicable, add screenshots to help explain your problem. --> ![Screenshot 2023-02-07 at 1 47 42 PM](https://user-images.githubusercontent.com/5244872/217338109-68360ebb-9f07-4a01-8d9b-33ceeb8a7a0e.png) <img width="829" alt="Screenshot 2023-02-07 at 1 47 04 PM" src="https://user-images.githubusercontent.com/5244872/217338124-37e19bc8-8c98-43c4-89f4-4f80476ca9aa.png"> Note: I tried to use Locations setup from SERVER ONE, and point a subpage as location SERVER TWO. However, it seems npm recognizes the input, still it shows error 404 Not Found **Operating System** <!-- Please specify if using a Rpi, Mac, orchestration tool or any other setups that might affect the reproduction of this error. --> Docker npm Synolog DSM **Additional context** <!-- Add any other context about the problem here, docker version, browser version, logs if applicable to the problem. Too much info is better than too little. -->
kerem 2026-02-26 07:32:32 +03:00
  • closed this issue
  • added the
    stale
    bug
    labels
Author
Owner

@cproensa commented on GitHub (Feb 25, 2023):

Try forwarding the location to 10.100.12.201/ (notice the slash at the end)
Also, seems that location must be /servertwo/, (also ending with slash), otherwise the subsequent pages will result in, eg: serverone.com/servertwoindex.html instead of serverone.com/servertwo/index.html
This may be a bug in itself

Still, even if it initially works, im having problems with some services messing with the url... but i dont know whose fault is at this point.

<!-- gh-comment-id:1445212097 --> @cproensa commented on GitHub (Feb 25, 2023): Try forwarding the location to `10.100.12.201/` (notice the slash at the end) Also, seems that location must be `/servertwo/`, (also ending with slash), otherwise the subsequent pages will result in, eg: _serverone.com/servertwoindex.html_ instead of _serverone.com/servertwo/index.html_ This may be a bug in itself Still, even if it initially works, im having problems with some services messing with the url... but i dont know whose fault is at this point.
Author
Owner

@redtripleAAA commented on GitHub (Feb 26, 2023):

@cproensa thanks for the response here!

I think your workaround/trick works! what is strange that sometimes I get the 404, and sometimes gets the good 200 response after that slash.

Similar to your issues, sometimes it messes with the url.

Strange issue, and I wish this issue gets addressed to be considered in v3 of npm.

<!-- gh-comment-id:1445279258 --> @redtripleAAA commented on GitHub (Feb 26, 2023): @cproensa thanks for the response here! I think your workaround/trick works! what is strange that sometimes I get the 404, and sometimes gets the good 200 response after that slash. Similar to your issues, sometimes it messes with the url. Strange issue, and I wish this issue gets addressed to be considered in v3 of npm.
Author
Owner

@cproensa commented on GitHub (Mar 18, 2023):

Similar to your issues, sometimes it messes with the url

The issues may happen with each app/website
If the target app has a configuration for an absolute path in its url, the proxyed access may not work.
For example:
The app expects to be running on http://realhost/, but the proxyed request is to http://proxyhost/myapp/
This app will redirect to http://proxyhost/login.html, and that won't work, because is outside of the proxyed location. The correct redirect should be to http://proxyhost/myapp/login.html
In this case, you need to configure the app to be served in the same path as the proxy location, in this example: http://realhost/myapp/

Other apps are "smart" and will derive the working url from the client headers, and will work without modification, under any relative path.

<!-- gh-comment-id:1475026288 --> @cproensa commented on GitHub (Mar 18, 2023): > Similar to your issues, sometimes it messes with the url The issues may happen with each app/website If the target app has a configuration for an absolute path in its url, the proxyed access may not work. For example: The app expects to be running on `http://realhost/`, but the proxyed request is to `http://proxyhost/myapp/` This app will redirect to `http://proxyhost/login.html`, and that won't work, because is outside of the proxyed location. The correct redirect should be to `http://proxyhost/myapp/login.html` In this case, you need to configure the app to be served in the same path as the proxy location, in this example: `http://realhost/myapp/` Other apps are "smart" and will derive the working url from the client headers, and will work without modification, under any relative path.
Author
Owner

@github-actions[bot] commented on GitHub (Jan 28, 2024):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:1913407511 --> @github-actions[bot] commented on GitHub (Jan 28, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@github-actions[bot] commented on GitHub (Mar 14, 2025):

Issue was closed due to inactivity.

<!-- gh-comment-id:2723141221 --> @github-actions[bot] commented on GitHub (Mar 14, 2025): Issue was closed due to inactivity.
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#1807
No description provided.