[GH-ISSUE #1462] Custom location error #1130

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

Originally created by @casperse on GitHub (Oct 5, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1462

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 at the bottom it says: v2.9.9 © 2021 jc21.com. Theme by Tabler :-)
  • Have you searched for similar issues (both open and closed)?

    • Yes & No - a subdir should work by using the "Custom location" but in my case it doesn't?

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

Originally created by @casperse on GitHub (Oct 5, 2021). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1462 <!-- I really think this is a bug, but if it isn't than please disregard it.... --> **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 at the bottom it says: v2.9.9 © 2021 jc21.com. Theme by Tabler :-) - Have you searched for similar issues (both open and closed)? - Yes & No - a subdir should work by using the "Custom location" but in my case it doesn't? **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](https://user-images.githubusercontent.com/2026859/136061046-f6e42d73-c4d5-4415-9b94-f2ab14b41fba.png) ![image](https://user-images.githubusercontent.com/2026859/136061184-5ac60661-a68b-4e4a-8c74-c6ec8df7d16e.png) 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](https://user-images.githubusercontent.com/2026859/136061462-cbc62523-750b-4d3c-a5ad-7d6fce3a6168.png) 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](https://user-images.githubusercontent.com/2026859/136061948-5129c30e-f8b5-46ec-9557-bb2cec968aed.png) 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
kerem 2026-02-26 06:35:53 +03:00
  • closed this issue
  • added the
    stale
    bug
    labels
Author
Owner

@chaptergy commented on GitHub (Oct 5, 2021):

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

<!-- gh-comment-id:934690051 --> @chaptergy commented on GitHub (Oct 5, 2021): Locations in nginx are tricky! It could be that you are simply missing a trailing slash on your location.
Author
Owner

@casperse commented on GitHub (Oct 6, 2021):

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

<!-- gh-comment-id:935566856 --> @casperse commented on GitHub (Oct 6, 2021): I have tried many combination of adding a slash :-) (/youtube-dl/)?/socket/ /socket/ /youtube-dl/socket/ /youtube-dl/
Author
Owner

@p-fruck commented on GitHub (Oct 24, 2021):

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 :)

<!-- gh-comment-id:950385470 --> @p-fruck commented on GitHub (Oct 24, 2021): 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 :)
Author
Owner

@Xanderlicious commented on GitHub (Jul 31, 2022):

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.

<!-- gh-comment-id:1200481098 --> @Xanderlicious commented on GitHub (Jul 31, 2022): 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](https://user-images.githubusercontent.com/78453004/182041723-a21f728b-871d-4b47-9805-50d02dc6ff2a.png) 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.
Author
Owner

@MichaelSL commented on GitHub (Jan 13, 2023):

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?

<!-- gh-comment-id:1382424148 --> @MichaelSL commented on GitHub (Jan 13, 2023): 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?
Author
Owner

@mike12806 commented on GitHub (Jan 18, 2023):

Seeing the same issue!

<!-- gh-comment-id:1386322356 --> @mike12806 commented on GitHub (Jan 18, 2023): Seeing the same issue!
Author
Owner

@idoodler commented on GitHub (Apr 24, 2023):

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/

<!-- gh-comment-id:1519938328 --> @idoodler commented on GitHub (Apr 24, 2023): Same issue here. Proxy Host: ![ProxyHost](https://user-images.githubusercontent.com/6825153/233979643-1293edaa-f236-4f77-9c6d-4b0e1bdc2283.png) Its Custom Location: ![CustomLocation](https://user-images.githubusercontent.com/6825153/233979688-c6e683ee-0477-4bdf-a0c1-151190169b5f.png) Proxy Host: https://projects.myDomain.tld <- Works as expected Custom Location: https://projects.myDomain.tld/projectName <- Results in `Cannot GET /projectName/`
Author
Owner

@alax commented on GitHub (May 2, 2023):

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/

<!-- gh-comment-id:1532288894 --> @alax commented on GitHub (May 2, 2023): 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/ `
Author
Owner

@idoodler commented on GitHub (May 5, 2023):

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!

<!-- gh-comment-id:1536004484 --> @idoodler commented on GitHub (May 5, 2023): > 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!
Author
Owner

@yakovlevkll commented on GitHub (Aug 15, 2023):

@alax I love you man, saved my day

<!-- gh-comment-id:1679303427 --> @yakovlevkll commented on GitHub (Aug 15, 2023): @alax I love you man, saved my day
Author
Owner

@regchanuk commented on GitHub (Dec 8, 2023):

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

works on firefox and thorium
image

<!-- gh-comment-id:1847357323 --> @regchanuk commented on GitHub (Dec 8, 2023): ![image](https://github.com/NginxProxyManager/nginx-proxy-manager/assets/46360316/aa4b590e-bb6f-4f1e-b55e-b52b582713f0) ![image](https://github.com/NginxProxyManager/nginx-proxy-manager/assets/46360316/3451b30f-72b1-4d84-a085-e406e757cf8d) seems im having issues with google chrome redirecting properly ![image](https://github.com/NginxProxyManager/nginx-proxy-manager/assets/46360316/c6142b3c-bcad-4b4f-9ad7-8492f5a4a140) works on firefox and thorium ![image](https://github.com/NginxProxyManager/nginx-proxy-manager/assets/46360316/e51468b5-de10-4dbe-b8a6-3f609c02c2bf)
Author
Owner

@regchanuk commented on GitHub (Dec 8, 2023):

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

<!-- gh-comment-id:1847400848 --> @regchanuk commented on GitHub (Dec 8, 2023): 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
Author
Owner

@blade10101 commented on GitHub (Feb 17, 2024):

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.

<!-- gh-comment-id:1950180974 --> @blade10101 commented on GitHub (Feb 17, 2024): 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.
Author
Owner

@github-actions[bot] commented on GitHub (Oct 8, 2024):

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

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

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

Issue was closed due to inactivity.

<!-- gh-comment-id:3399797220 --> @github-actions[bot] commented on GitHub (Oct 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#1130
No description provided.