NginxProxyManager / NginxProxyManager/nginx-proxy-manager
"force https" redirect needs additional 308 for POST requests
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 34.2k
- Forks
- 3.9k
- Avg merge
- 21h 12m
- Merged PRs (30d)
- 20
Description
301-redirected POST requests sometimes become GET requests after the redirect, I noticed this for all clients, that use .NET HttpClient. But even if redirected requests keep their "Request-Method: POST" header, they still loose the POST Payload.
Please have a look at this 2 descriptions:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/301
Use the 301 code only as a response for GET or HEAD methods and use the 308 Permanent Redirect for POST methods instead, as the method change is explicitly prohibited with this status.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/308
The request method and the body will not be altered, whereas 301 may incorrectly sometimes be changed to a GET method.
Unfortunately, I'm a nginx noob, so I can't provide a solution and stackoverflow topics seem not to provide a solution for this particular problem, but I can help testing possible solutions.
p.s.: thank you for your awesome work!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the force-HTTPS redirect configuration in Nginx Proxy Manager and reproduce the behavior with a POST request, checking the redirect status and preserved payload. Review the linked MDN descriptions for 301 and 308 semantics. Done means POST requests are redirected without changing method or losing the request body, while existing GET and HEAD redirects continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nginx
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100