Skip to content

How to redirect FROM a subfolder to a backend service #3950

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Chaxiraxi opened this issue Aug 22, 2024 · 5 comments
Closed

How to redirect FROM a subfolder to a backend service #3950

Chaxiraxi opened this issue Aug 22, 2024 · 5 comments

Comments

@Chaxiraxi
Copy link

I don't understand how custom locations work. I want to redirect as follows:
admin.example.com/phpmyadmin/ -> http://phpmyadmin:80/
admin.example.com/pihole/ -> http://pihole:80/admin/

The custom locations seems to be able to redirect only from subdomains to subfolders, but not the opposite...

@Chaxiraxi Chaxiraxi changed the title Redirect FROM a folder How to redirect FROM a subfolder to a backend service Aug 22, 2024
@jannismilz
Copy link

Hey @Chaxiraxi

So what do you mean with "redirect"?
I assume it's not a redirect host but you rather want to "redirect the traffic" to these addresses, right?

If yes, the first one is pretty easy.
For the second you most likely need some custom nginx config code to redirect to a specific path on the destination as well.

@Chaxiraxi
Copy link
Author

I meant forward the request actually yup, sorry for the confusion. But I can't really understand the interface. I expect the configuration to work in the screenshot, but I get a ERR_SSL_UNRECOGNIZED_NAME_ALERT error in HTTPS, or a 404 openresty error via HTTP...
image

@jannismilz
Copy link

Okay I understand.

That doesn't work like that. Have you already defined something for admin.example.com itself?
Because what you need to do is go to "Custom locations" and add it there like the following:
Screenshot 2024-08-23 at 17 54 36

@Chaxiraxi
Copy link
Author

Understood, but filling the "Details" tab is mandatory, and I don't want that the base domain itself forwards to anything.
I tried the following:
image
image

But when I try to access my admin panel I get an ERR_SSL_UNRECOGNIZED_NAME_ALERT via https
image

And via HTTP I get this on the base domain:
image

and a 404 on the /phpmyadmin location:
image

@Chaxiraxi
Copy link
Author

Oh well... This Reddit post answered my question I guess... Nginx Proxy Manger doesn't have the feature by default for this very specific, yet common and useful case. I'll come back to the good old manual Nginx configuration then I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants