nginx-craft icon indicating copy to clipboard operation
nginx-craft copied to clipboard

Adding trailing slash causes an unnecessary 307 internal redirect

Open peimansh opened this issue 5 years ago • 0 comments

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.

peimansh avatar Dec 17 '19 14:12 peimansh