mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 17:35:52 +03:00
[GH-ISSUE #95] Confused by Custom location usage/settings #84
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#84
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 @binhex on GitHub (Mar 6, 2019).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/95
I see that custom locations has been added to proxy hosts, fantastic!, however im struggling to get my head around the configuration.
so firstly what i want to achieve is to be able to externally access url:-
https://<domain name>/<name of app>and have it reverse proxy to:-
http(s)://<internal ip address or hostname>:<port number>/<optional sub folder name>e.g.
https://foo.bar.com/plex => http://192.168.1.10:1234/So at the moment i dont think the 'custom locations' let you do this, correct?.
the other thing i cant quite grasp is the requirement to fill in a 'forward hostname / ip' for both the details AND the custom location(s), surely if you are using custom locations then you shouldnt require a global 'forward hostname / ip' in the 'details' tab, not really sure what should go in there, or why its required, im obviously not thinking about this in the way its been designed, can you tell me how it should work?.
Thanks again for your hard work, i truly appreciate it, this has been something i have wanted for a very long time.
@jc21 commented on GitHub (Mar 7, 2019):
https://foo.bar.com/plex => http://192.168.1.10:1234/<- Yep that should work.The optional sub-folder on the destination server you've suggested, isn't supported yet though.
So yes you need a default forwarding service for a proxy host. If you don't want to forward to anywhere specific, just put in
127.0.0.1with port 1000 or something random, it won't forward and you have no problems.I personally don't understand why everyone wants sub-folders at all anyway. For me,
plex.example.comis better thanexample.com/plex.On the topic of upstream web services, this sub-folder forwarding is an advanced feature. Only people who understand the reverse proxying should attempt it. In my testing with some services I found that the upstream service (ie Plex) returned HTML with assets linking to
/styles.cssas an example, not/plex/styles.cssas you might expect. So the page won't render anything more than HTML. This is because the service has no idea what you're doing in front of it. Some services allow you to specify a "base url" parameter in their configs, but not always.In my software for example, I assume that the base url of the admin interface is going to be
/and I don't have anyway for people to modify that.@binhex commented on GitHub (Mar 7, 2019):
the reason (at least for me) that i would like sub folders is to reduce admin, having a single domain and thus a single certificate to manage is a lot easier (and cheaper - not using letsencrypt) than having say a dozen hostnames and certificates. i understand that you can generate multiple certs for nothing using letsencrypt but even then the potential for the letsencrypt re-certification process to go wrong is increased due to the multiple requests for certs
yeah this is a downside of using sub-folders most definitely, it can mostly be worked around by configuring the application to use a sub-folder that matches thus the problem goes away, not all apps can be configured though, so for those apps you have no option but to use a separate domain name and cert.
i have taken on board your comments and i appreciate the reply.
@creedda commented on GitHub (Oct 2, 2020):
Hey @binhex did you get this working?
If so, could you send a screenshot showing what your configuration looks like in the gui? Been struggling to get this to work over the last few days.
Thanks,
@123dev commented on GitHub (Nov 30, 2020):
Care to clarify how to get this to work?
We have two services running on host1
host1:port1 and host1:port2
We setup Proxy Host "Domain name" to forward to
http://host1:port1
So we are able to access http://domain_name and can reach to host1:port1 without any issues.
Next we wanted to access http://domain_name/api to reach to host1:port2
We added custom locations: (to the same proxy host configuration)
location: /api
scheme: http
Forward host/ip: host1
Forward port: port2
Sounds simple, but we're getting 502
What are we missing?
Thanks
@123dev commented on GitHub (Nov 30, 2020):
It looks like domain/api is being proxied to host1:port2/api instead of host1:port2/
From the logs
@123dev commented on GitHub (Nov 30, 2020):
OK,
Setting: Forward host/ip: to
ip: host1/instead ofip: host1Gets me to what I need.
Sorry about the noise