How to redirect http to https on digital ocean droplet?

Hello All,
I’ve installed discourse via digital ocean droplet. I want to redirect www and http to https how to do it?
I did search a lot but couldn’t find a solution. Most of the posts on this topic are talking about SSL.
Any help?

Hiya. :wave:

Let’s clarify what are are asking:

  • www is a sub-domain
  • http and https are protocols

They are definitely related, but it’s hard to tell what you need done. If you can’t use a domain, you can use, so for instance, you might say:

I’m trying to redirect to

Depending on what needs to be redirected, it may be a Discourse configuration, a web server setting, or something at your domain registrar, hence why we need more details. :slight_smile:

1 Like

I want to redirect followings to to

You can use to make your apex domain redirect to www. The http → https on www works already.

A more complicated way, that I don’t currently know how to accomplish is Set up Let’s Encrypt with multiple domains (the old directions seem not to work now), so I recommend useing

I intend to figure out how to solve the problem with the multiple-domaim solution, but too much other paying work is in the way.

1 Like

Thanks for the reply.
I’m new to docker/discourse/RoR so not sure what exactly it uses underneath?
What does discourse use as web server? nginx or apache? Can’t we redirect subdomain from any config file?