nginx-craft
nginx-craft copied to clipboard
Adding trailing slash causes an unnecessary 307 internal redirect
I have found an issue where Nginx tries to add trailing slash to the URIs, then there happens double redirect. The default redirect for adding trailing slash does the redirect in HTTP protocol and then does another redirect to HTTPS which causes an extra unnecessary "internal redirect 307" status in the process.
For example: https://somedomain.com/some-article --> http://somedomain.com/some-article/ -301 moved permanently http://somedomain.com/some-article/ --> https://somedomain.com/some-article/ -307 internal redirect https://somedomain.com/some-article/ --> 200 status OK
I'm not expert in Nginx configurations so I'm wondering if this could be solved by some code tweak or this is a code bug and should be patched.