[GH-ISSUE #1580] Specific Location is working, General Location is giving 404 for same URI #1190

Closed
opened 2026-02-26 06:36:09 +03:00 by kerem · 5 comments
Owner

Originally created by @zane-shus on GitHub (Nov 10, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1580

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
I have created a working Host. When I added a very specific location (down to the PHP page level e.g. /subfolder/page.php ) for a sub URI to go to a different backend container I am able to get locations to work, but when I create a generic location (at the /subfolder/ level), it is not able to work. As I am only making a small change, I am assuming its a bug.

Nginx Proxy Manager Version

To Reproduce
Steps to reproduce the behavior:

  1. Create two backends, and get NPM to point to the first.
  2. Create a location in the host

image
4. Hit your site.com/othercontainer/test.php and it works
5. Then, Change the location to be generic
6.
image
7. Now I can no longer get to site.com/othercontainer/test.php
8. I am getting a 404 Not Found which I believe is coming from site.com

Expected behavior
I would have expected them to hit the same content

Screenshots
As attached in description

Operating System
Using NPM within Portainer on Docker Swarm, on CentOS hosts. All are latest versions.

Additional context
None

Originally created by @zane-shus on GitHub (Nov 10, 2021). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1580 **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** I have created a working Host. When I added a very specific location (down to the PHP page level e.g. /subfolder/page.php ) for a sub URI to go to a different backend container I am able to get locations to work, but when I create a generic location (at the /subfolder/ level), it is not able to work. As I am only making a small change, I am assuming its a bug. **Nginx Proxy Manager Version** <!-- What version of Nginx Proxy Manager is reported on the login page? --> **To Reproduce** Steps to reproduce the behavior: 1. Create two backends, and get NPM to point to the first. 2. Create a location in the host 3. ![image](https://user-images.githubusercontent.com/50510607/141174328-169b461e-ebbe-4dcc-9b3f-7a9b64d84b28.png) 4. Hit your site.com/othercontainer/test.php and it works 5. Then, Change the location to be generic 6. ![image](https://user-images.githubusercontent.com/50510607/141174479-249b4a2c-94e7-47dc-a4e6-8449abc1b1fe.png) 7. Now I can no longer get to site.com/othercontainer/test.php 8. I am getting a 404 Not Found which I believe is coming from site.com **Expected behavior** I would have expected them to hit the same content **Screenshots** As attached in description **Operating System** Using NPM within Portainer on Docker Swarm, on CentOS hosts. All are latest versions. **Additional context** None
kerem 2026-02-26 06:36:09 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@chaptergy commented on GitHub (Nov 10, 2021):

Unfortunately locations have been a little broken for a few versions, unfortunately all attempts to mitigate the problem have resulted in other issues. https://github.com/jc21/nginx-proxy-manager/pull/1578 reverted all the changes related to that hopefully resulting in locations working properly again. But you'll have to wait until a new release is published.

<!-- gh-comment-id:965672928 --> @chaptergy commented on GitHub (Nov 10, 2021): Unfortunately locations have been a little broken for a few versions, unfortunately all attempts to mitigate the problem have resulted in other issues. https://github.com/jc21/nginx-proxy-manager/pull/1578 reverted all the changes related to that hopefully resulting in locations working properly again. But you'll have to wait until a new release is published.
Author
Owner

@zane-shus commented on GitHub (Nov 10, 2021):

Unfortunately locations have been a little broken for a few versions, unfortunately all attempts to mitigate the problem have resulted in other issues. #1578 reverted all the changes related to that hopefully resulting in locations working properly again. But you'll have to wait until a new release is published.

thanks for this. Would it be possible to manually do it in this area instead?
image

(I come from HAProxy, this is my first dip into NGINX, so a little green)

<!-- gh-comment-id:965677244 --> @zane-shus commented on GitHub (Nov 10, 2021): > > > Unfortunately locations have been a little broken for a few versions, unfortunately all attempts to mitigate the problem have resulted in other issues. #1578 reverted all the changes related to that hopefully resulting in locations working properly again. But you'll have to wait until a new release is published. thanks for this. Would it be possible to manually do it in this area instead? ![image](https://user-images.githubusercontent.com/50510607/141181420-019a5386-f434-4265-acda-ec7df80d1ff3.png) (I come from HAProxy, this is my first dip into NGINX, so a little green)
Author
Owner

@chaptergy commented on GitHub (Nov 10, 2021):

Yes you can, by adding something like this:

location /app/ {
    proxy_pass      http://othercontainer/;
}
<!-- gh-comment-id:965682224 --> @chaptergy commented on GitHub (Nov 10, 2021): Yes you can, by adding something like this: ```nginx location /app/ { proxy_pass http://othercontainer/; } ```
Author
Owner

@zane-shus commented on GitHub (Nov 10, 2021):

location /app/ {
    proxy_pass      http://othercontainer/;
}

your a champion, thank you! Worked perfect.

<!-- gh-comment-id:965722219 --> @zane-shus commented on GitHub (Nov 10, 2021): > ```nginx > location /app/ { > proxy_pass http://othercontainer/; > } > ``` your a champion, thank you! Worked perfect.
Author
Owner

@chaptergy commented on GitHub (Nov 10, 2021):

Great to hear! Then I'll close this for now. Be on the lookout for new releases, so you could potentially change back to the built in locations. Or leave it in the advanced config. Your choice ;)

<!-- gh-comment-id:965723355 --> @chaptergy commented on GitHub (Nov 10, 2021): Great to hear! Then I'll close this for now. Be on the lookout for new releases, so you could potentially change back to the built in locations. Or leave it in the advanced config. Your choice ;)
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#1190
No description provided.