-
Notifications
You must be signed in to change notification settings - Fork 425
Conversation
First of all, thanks for the PR; I think this is a common use case that isn't currently easy to handle I'd like to 301 https://www.devmemphis.org to https://devmemphis.org First, I've added the updated buildpack:
Then I added {
"root": "public/",
"https_only": true,
"error_page": "404",
"canonical_host": "devmemphis.org",
"headers": {
"/**.js": {
"Cache-Control": "public, max-age=0, must-revalidate"
}
}
} My expectation was that it would redirect but it doesn't seem to be working. Am I missing something? 🤔 |
Just to update, I noticed I was pointing to the wrong branch before but I've updated it and I still have the same issue:
|
I have the same config you have, with the buildpack Did you redeploy your app once you updated the buildpack ? Can you try with another browser, maybe there is some kind of cache, a conflic with a plugin like HTTPS everywhere etc |
@root-io You're right. It was just a matter of clearing the cache in my browser. I can confirm that this works for redirecting both www to non-www and vice versa. Props on adding this; thanks a lot! |
Awesome, thanks for your feedback ! ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nginx configuration is not a strength of mine, but I wonder whether there is a way to make sure the correct scheme is used even when the Heroku router sends all requests over HTTP rather than HTTPS?
We're using this branch and would love to see this merged. For anyone working at Heroku, the use-case for us is we're deploying a Single Page Application written in React to Heroku. The static buildpack simplifies delivery and reduces performance and security concerns. However, we have two subdomains that we want to handle with one application, and would like to redirect from the secondary host to the canonical host. Without this change merged, we have to choose between picking a buildpack fork that may not be kept up-to-date, adding the complexity and risks of adding a custom webserver, or writing a Is it not a common use-case for us to have one application respond to more than one domain (e.g. a |
We need this too and would love to see it merged. Using https://github.com/keepworks/heroku-buildpack-static for now. |
Thanks y'all. Bringing this in. |
Add support for canonical host (e.g for SEO purpose)
I was inspired by https://github.com/keepworks/heroku-buildpack-static but simplify the nginx config.
Resolve #60 #110 #135