health check: malformed request [http vs https] #1204
Replies: 5 comments
-
|
My hunch is the issue with following SSL config you have in production.rb, try removing and see if it helps. The healthcheck is at |
Beta Was this translation helpful? Give feedback.
-
|
I had this issue and I struggled for hours to get past it. Here are all of the things that I needed to do, I don't know if they are all necessary but I wound up getting things to work: Upgrade to Rails 8I updated the gem in my Gemfile, and I ran # Assume all access to the app is happening through a SSL-terminating reverse proxy.
config.assume_ssl = true
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
config.force_ssl = true
# Skip http-to-https redirect for the default health check endpoint.
# config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }Install Thruster and update the Dockerfile
EXPOSE 80
CMD ["./bin/thrust", "./bin/rails", "server"]Go back to defaults in
|
Beta Was this translation helpful? Give feedback.
-
|
I ended up with this config in my production.rb What i also did was remove all images and containers from the server before deploying again. After that it worked for me. Don't know what did the trick ¯_(ツ)_/¯ |
Beta Was this translation helpful? Give feedback.
-
|
The issue I encountered is that I am deploying an accessory with a third-party image, so I cannot modify the source code. Since user authentication is enabled, the HTTP status returned is not 200, which causes the health check to fail. |
Beta Was this translation helpful? Give feedback.
-
|
Hey guys I was struggling with this matter yesterday with an "old" rails 7 app all you guys shared help me a lot, I will give my solution in order to help others in future So I look this comment: #1204 (comment) (same problem i had) Then this one: #1204 (comment) (the possible solution) For those with rails apps prior to 8 version, its not necessary to upgrade (if you upgrade if you are not really sure if you already have a funcional app or platform making money or serving users, so structure your upgrade plan) I look into these files on rails repo: https://github.com/rails/rails/blob/main/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt Also and very important read your proxy logs with If this is your case as the initial comment then use the production.rb.tt form rails 8 generator and exclude only the '/up' route: Check your config/deploy.yml in case you have another rails server PORT, or set the env. Also check your Dockerfile at the very end rails 7 app Thats every thing you need, you don need to upgrade (at least now) and you don't have to install thruster unless you really needed. I hope it helps for those with apps prior to rails 8 🚀 |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all
I'm trying to deploy a RoR app to a digitalocean droplet. The healthcheck seems to fail because it is doing so with an https connection while it expects http. The rails app is quite new with little config. Deploying to server was my first step after creating a quick landingpage. Hopefully someone can point me in the right direction.
Addition to production.rb on recommendation of claude. (although kamal 2.0 is too new for claude to be much help)
deploy.yml
error message from kamal:
Beta Was this translation helpful? Give feedback.
All reactions