How do I redirect http to https on adonis

I’m hosting my app on heroku. I don’t know the path to the Let’s Encrypt SSL cert and key.

How do I redirect my site request to https?

As per my understanding, it will auto changed to https when deployed to heroku

1 Like

The site is already deployed to heroku. I upgraded to a paid dyno and have the heroku Let’s Encrypt certificate.
I don’t know the path to the cert, so the guide here doesn’t work.

Not sure how cert management works in Heroku but here seems to be some guide:

Also read from somewhere, that you have to redirect from HTTP to HTTPS yourself in application layer. Adonis middleware is perfect for it

In middleware you can check if request is HTTP or HTTPS and then redirect from HTTP to HTTPS when required


I did that but got the following error:

site redirected you too many times.