NginxProxyManager / nginx-proxy-manager

Docker container for managing Nginx proxy hosts with a simple, powerful interface
https://nginxproxymanager.com
MIT License
22.95k stars 2.66k forks source link

Custom location error #1462

Open casperse opened 3 years ago

casperse commented 3 years ago

Checklist

Describe the bug I have moved away from SWAG to nginx-proxy-manager-official docker

Adding my subdomian youtube.domain.com and I get the cert. (That part works!) 1) http://192.168.0.6:8282/youtube-dl - works (Docker: https://github.com/manbearwiz/youtube-dl-server) 2) Adding it to nginx-proxy-manager-official docker image image

I have also tried using: (/youtube-dl/)?/socket

And I also tried adding two locations: /socket /youtube-dl/socket

They all just give the same error when I try to go to: https://youtube.domain.com I keep getting the error webpage image

But I can see it working if I add the custom location after the domain: adding "/youtube-dl" after the http with cert it works? https://youtube.domain.com/youtube-dl image

Shouldnt nginx-proxy-manager not add the /youtube-dl to the domain path?

Nginx Proxy Manager Version v2.9.9 © 2021 jc21.com. Theme by Tabler

chaptergy commented 3 years ago

Locations in nginx are tricky! It could be that you are simply missing a trailing slash on your location.

casperse commented 3 years ago

I have tried many combination of adding a slash :-) (/youtube-dl/)?/socket/ /socket/ /youtube-dl/socket/ /youtube-dl/

p-fruck commented 3 years ago

If I understood correctly, you are trying to proxy domain.com/example to 192.168.0.6:8282/youtube-dl/example, right? In this case, you could try to set the location to / and the forward name to 192.168.0.6/youtube-dl. ~If you want to force https redirect, you might have to add include conf.d/include/force-ssl.conf; to the custom config using the button with the wheel icon, since the automatic redirect is overwritten otherwise.~ This seems to be outdated :)

Xanderlicious commented 2 years ago

I appear to have a similar issue.

I have 3 hosts that use custom locations.

2 of them experienced the issues mentioned above and it doesn't append the location at the end when navigating. Its as if the field in NPM is still blank - even though it isn't.

after countless times of typing it in and different conbinations of pressing enter and tabbing to the next field and then pressing save, it eventually recognises that there is something entered into the location field in custom locations and then when navigating in a browser to the path, it appends the location at the end of the URL and works.

I have so far got 2 of the 3 hosts working but it really shouldn't be like this

UPDATE: tried a reboot of the server and stack and now the 2 that were working are now not. The location is no longer being appended despite nothing changing. If I manually add the location at the end, the host works as intended. Just doesn't do it automatically.

UPDATE2: updated the stack and we are back to the 2 out of the 3 working again.

image

I am going to https://subdomain.domain.co.uk and i am wanting it to output as if I had entered https://subdomain.domain.co.uk/admin (SSL certs and DNS records are in place correctly)

if i enter the url manually it works, just doesn't re-direct automatically - am i doing something wrong? - it works for the other hosts - just not this one.

MichaelSL commented 1 year ago

I have similar issue with the locations: I add proxy domain to myhost.com I add location /api and point it to one of the hosts in my network host-01.lan

When I try to navigate to http://myhost.com/api/health I expect that my app will get a request with path /health, but it's getting a request with full /api/health path which is unexpected. My endpoint is at /health url so the app shouldn't know about the sub location part.

Can this configuration be achieved?

mike12806 commented 1 year ago

Seeing the same issue!

idoodler commented 1 year ago

Same issue here.

Proxy Host: ProxyHost

Its Custom Location: CustomLocation

Proxy Host: https://projects.myDomain.tld <- Works as expected Custom Location: https://projects.myDomain.tld/projectName <- Results in Cannot GET /projectName/

alax commented 1 year ago

The solution for me was to add a trailing slash in Forward Hostname / IP. So, instead of 172.17.0.1 for the IP, you'd put 172.17.0.1/

idoodler commented 1 year ago

The solution for me was to add a trailing slash in Forward Hostname / IP. So, instead of 172.17.0.1 for the IP, you'd put 172.17.0.1/

Thats it, thanks!

yakovlevkll commented 1 year ago

@alax I love you man, saved my day

regchanuk commented 11 months ago

image image seems im having issues with google chrome redirecting properly image

works on firefox and thorium image

regchanuk commented 11 months ago

details page i have it forwarded to 192.168.50.201/

custom location location /bb fw host name as following 192.168.50.201/bb forward 443

blade10101 commented 8 months ago

Nginx don't seem to work with custom locations. I wanted /api/ to go to a ip. But I notice nginx also won't use the docker container name as a IP like I've seen its suppose to work. Is there a old version. Of nginx proxy manager where custom locations work? It just says offline. I had one setup before and it worked then after a reboot it just stopped for no reason. It used to work but I think the newer version has bugs.

github-actions[bot] commented 1 month ago

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