Closed dekobon closed 1 year ago
I think your changes here look good, but doing some testing I found some odd behavior. I'm not 100% sure of all my conclusions, but I put together draft PR for your reference for possible inclusion into this change. https://github.com/nginxinc/nginx-s3-gateway/pull/169
This PR fixes the issue #164
Expectations
This solution assumes that the following configuration options are set to true
APPEND_SLASH_FOR_POSSIBLE_DIRECTORY
PROVIDE_INDEX_PAGE
ALLOW_DIRECTORY_LIST
Given a folder
test
with anindex.html
present in the directory, theindex.html
should be served for:/test
/test/
/test?foo=bar
/test/?foo=bar
Given a folder
test
WITHOUT anindex.html
present in the directory, files in the directory should be listed for:/test
/test/
/test?foo=bar
/test/?foo=bar
Notes
@trailslash
was rewriting to$request_uri
with a trailing slash on the end. In the case of/test?foo=bar
we'd wind up with/test?foo=bar/
which when combined with the other changes led to a rewrite loop