-
Notifications
You must be signed in to change notification settings - Fork 426
Double Redirect - https to http with trailing slashes #103
Double Redirect - https to http with trailing slashes #103
Comments
Sorry to dig this up, but we have the exact same problem currently. I was wondering if you have figured out how to solve this? |
@herrbuerger this is one of two issues that I have open with Heroku and neither of them have had responses in over a year 😞 One of which actually has a PR that fixes the issue. My only recommendation for you would be to look at alternative hosting possibilities. I have moved all my static stuff onto Netlify since none of the static buildpack issues seem to be getting any love |
@mansona thanks for the quick response. I've spend some hours looking into that and the only thing that came up which might solve the problem is a new directive in later nginx versions But the nginx version used in the buildpack is ancient, so I'm currently evaluating if it makes sense for us to update it, though it's probably wiser to go directly with the nginx buildpack. Big fan of Netlify and I'd move instantly if that was a possibility (which it isn't :() |
+1 |
1 similar comment
+1 |
Actually; I just discovered there is a much simpler issue.
The third redirection is caused by The "double redirect" is annoying indeed, but it's only an incidence of the main issue : The first automatic redirection is mandatory (no config to disable it), pretty annoying, and also so opiniated... EDIT: And one should add "Opiniated" yes, but furthermore non-standard opinion. |
This was confusing me today. It's very unfortunate that we need a redirect for all page loads. |
Same issue here, just noticed it, not very cool. |
This should be fixed by the change in #215. Would be nice to get merged. |
…rects This fix is experimental, to say the least. It assumes this pull request to be present: heroku/heroku-buildpack-static@6798b79 This solution is based on the following converstation: heroku/heroku-buildpack-static#103 For this reason, I created a fork of the latest version of Heroku's buildpack that includes the commit from the aforementioned PR: https://github.com/thesauri/heroku-buildpack-static
I encountered a similar issue for a host residing behind an nginx redirect. When visiting subdomains such as I managed to solve this issue by using #215, so I would appreciate it being merged too (assuming there is no other way to do this that is more correct). |
Hi This buildpack is now deprecated and we are recommending people move the more actively maintained heroku-buildpack-nginx. For migration advice see here. As such, I'm closing this issue out since we won't be making further changes to this buildpack. |
Hey folks 👋
I'm using this static build pack with
https_only
turned on. Our app is predominantly a set ofindex.html
files in folders so that we can access them like this: https://example.com/post/a-lovely-blog-post/ which would then serve/post/a-lovely-blog-post/index.html
as expected.The problem is that when you navigate to https://example.com/post/a-lovely-blog-post (no trailing slash) it then redirects you to http://example.com/post/a-lovely-blog-post/ (trailing slash but http) which then redirects you again to https://example.com/post/a-lovely-blog-post/ (trailing slash and https) because of
https_only
I can't quite track exactly where that intermediate 301 redirect is coming from (the one that adds the trailing slash but removes https). If someone could point me in the right direction I would be happy to introduce a PR to fix it 👍
The text was updated successfully, but these errors were encountered: