user1072337
user1072337

Reputation: 12945

Redirecting a Meteor app from naked domain to www with https (ssl) on

I am trying to redirect my Meteor app (hosted by Heroku) to www with https on. So:

https://exampledomain.com -> https://www.exampledomain.com

Is there a way to do this either in Heroku or the Meteor application itself?

Upvotes: 0

Views: 125

Answers (1)

Jesper We
Jesper We

Reputation: 6087

Meteor by itself cannot do redirects and does not support https.

Heroku is a hosting service, and will host whatever compatible application you give it, on top of it's Cedar stack, which is basically an Ubuntu OS. It does not even know that your app will be using http. So the Heroku environment will not help you either.

What you need to do is build an Heroku app consisting of your Meteor app and a HTTP Reverse Proxy in front of it, which handles the redirect you are asking for, and also the https. This proxy terminates the https connections coming from the Internet, and serves them as http to your Meteor app behind it.

The easiest proxy to set up is Nginx, although HAProxy also works well.

Have a look at for example Have you managed to make your node nginx proxy setup on Heroku work? for how to set this up.

Upvotes: 0

Related Questions