-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
URLs with trailing slashes are broken #109
Labels
bug
Something isn't working
enhancement
Improve or enhance existing content or functionality
site devops
Deployment, tooling, configuration for this website
Comments
Merged
Notgnoshi
added a commit
that referenced
this issue
Sep 6, 2021
The issue: Using autoindex for directories without an index requires that the directory $uri ends in a slash. But using trailing slashes with file $uri's results in a 404. Handle the following cases: $ docker restart nginx-root && sleep 0.5 && ./scripts/check-redirects.sh URL Resolved URL HTTP Response http://localhost http://localhost/ 200 http://localhost/ http://localhost/ 200 http://localhost/index.html http://localhost/ 200 http://localhost/index http://localhost/index 200 <-- Still undesirable http://localhost/css http://localhost/css/ 200 http://localhost/css/ http://localhost/css/ 200 http://localhost/css/index.html http://localhost/css/ 200 http://localhost/vim http://localhost/vim 200 http://localhost/vim/ http://localhost/vim/ 200 http://localhost/vim/index.html http://localhost/vim/ 200 http://localhost/vim/index http://localhost/vim/index 200 <-- Still undesirable http://localhost/vim.html http://localhost/vim 200 http://localhost/vim/text-objects http://localhost/vim/text-objects 200 http://localhost/vim/text-objects/ http://localhost/vim/text-objects 200 http://localhost/vim/text-objects.html http://localhost/vim/text-objects 200 http://localhost/vim/text-objects/index.html http://localhost/vim/text-objects 200 http://localhost/graphviz http://localhost/graphviz 200 http://localhost/graphviz/ http://localhost/graphviz 200 http://localhost/graphviz.html http://localhost/graphviz 200 http://localhost/graphviz/index.html http://localhost/graphviz 200 http://localhost/404.html http://localhost/404 404 http://localhost/blog/product-spaces http://localhost/product-spaces 200 http://localhost/blog/product-spaces/ http://localhost/product-spaces 200 http://localhost/blog/product-spaces.html http://localhost/product-spaces 200 http://localhost/blog/product-spaces/index.html http://localhost/product-spaces 200 Note that the Nginx documentation states that you shouldn't use 'if' in a location block. You should almost always use try_files, return, or rewrite. But I couldn't find a way to resolve the issue without it. Closes #109
Notgnoshi
added a commit
that referenced
this issue
Sep 6, 2021
The issue: Using autoindex for directories without an index requires that the directory $uri ends in a slash. But using trailing slashes with file $uri's results in a 404. Handle the following cases: $ docker restart nginx-root && sleep 0.5 && ./scripts/check-redirects.sh URL Resolved URL HTTP Response http://localhost http://localhost/ 200 http://localhost/ http://localhost/ 200 http://localhost/index.html http://localhost/ 200 http://localhost/index http://localhost/index 200 <-- Still undesirable http://localhost/css http://localhost/css/ 200 http://localhost/css/ http://localhost/css/ 200 http://localhost/css/index.html http://localhost/css/ 200 http://localhost/vim http://localhost/vim 200 http://localhost/vim/ http://localhost/vim/ 200 http://localhost/vim/index.html http://localhost/vim/ 200 http://localhost/vim/index http://localhost/vim/index 200 <-- Still undesirable http://localhost/vim.html http://localhost/vim 200 http://localhost/vim/text-objects http://localhost/vim/text-objects 200 http://localhost/vim/text-objects/ http://localhost/vim/text-objects 200 http://localhost/vim/text-objects.html http://localhost/vim/text-objects 200 http://localhost/vim/text-objects/index.html http://localhost/vim/text-objects 200 http://localhost/graphviz http://localhost/graphviz 200 http://localhost/graphviz/ http://localhost/graphviz 200 http://localhost/graphviz.html http://localhost/graphviz 200 http://localhost/graphviz/index.html http://localhost/graphviz 200 http://localhost/404.html http://localhost/404 404 http://localhost/blog/product-spaces http://localhost/product-spaces 200 http://localhost/blog/product-spaces/ http://localhost/product-spaces 200 http://localhost/blog/product-spaces.html http://localhost/product-spaces 200 http://localhost/blog/product-spaces/index.html http://localhost/product-spaces 200 Note that the Nginx documentation states that you shouldn't use 'if' in a location block. You should almost always use try_files, return, or rewrite. But I couldn't find a way to resolve the issue without it. Closes #109
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
enhancement
Improve or enhance existing content or functionality
site devops
Deployment, tooling, configuration for this website
This was caused by e20cf9a which fixed an infinite redirect loop when trying to access directories with an autoindex.
This is exacerbated by the RSS feed generator in #14, which adds a trailing slash to every URL.
The text was updated successfully, but these errors were encountered: