-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Open
Labels
Description
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 ( part of the issue being reported here is already reported in this ticket - Unable to setup any Redirection Host #4080 )
Describe the bug
When creating a redirect host using the API endpoint api/nginx/redirection-hosts
with "forward_scheme": "auto"
, the redirect results in a broken URL like auto://google.com
. This is not a valid scheme and causes the redirect to fail.
Additionally, when attempting to set "auto"
as the scheme in the web UI, the following validation error is shown: data/forward_scheme must be equal to one of the allowed values
This reveals inconsistent behavior:
- The API accepts
"auto"
but results in a broken redirect. - The UI correctly rejects
"auto"
as invalid although it is an option in the form.
Nginx Proxy Manager Version
v2.12.6
To Reproduce
- Using the REST API:
- Send a
POST
request to/api/nginx/redirection-hosts
with the following JSON payload:
{
"domain_names": ["mydomain.com"],
"forward_scheme": "auto",
"forward_domain_name": "google.com",
"forward_http_code": 300,
"preserve_path": true
}
- Access http://mydomain.com in a browser.
- Observe that the redirect attempts to go to auto://google.com.
- Using the UI:
- Open the Nginx Proxy Manager web UI.
- Go to the "Redirect Hosts" section and click "Add Redirection Host".
- Fill in domain and forward details.
- Set Scheme = auto.
- Try to save.
- See the following error:
data/forward_scheme must be equal to one of the allowed values
Expected behavior
- If "auto" is intended to be a supported scheme, the redirect should dynamically use the original request's scheme (http or https).
- If "auto" is not a supported value, it should be rejected consistently across both the API and UI with a validation error.
Additional context
A related issue (#4080) covers the UI validation problem, but this report also includes the API behavior and resulting redirect failure.