How to setup https + domain?

I have my Consul running at http://server-ip/

How can I have it with https ?
I’ve tried changing the line
config.force_ssl = false
in the file
\home\deploy\consul\current\config\environments\production.rb
but it made the site unavailable.

And, how can I have the site under my domain chaumont-renaissance.fr instead of server-ip ?

Hi @LudoEducatif!!

You need to configure your web server to use a ssl certificate. Have you a certificate SSL? What web server are you running?

If you want to have your domain instead of the IP, you need configure your dns server to point to the static ip address of your web server.

Regards,

Hi @sturpin and thanks for your reply, it helped me to go forward.

I’ve pointed my CloudFlare DNS to my server with Consul on it, and I’ve setup the SSL.
I’m using Nginx and I’m stuck on that :
I’ve tried to configure a Nginx server for my domain, but I don’t know how to set up the root and index :

root /home/deploy/consul/current;
index index.html index.php; 

this doesn’t work, it gives a 403, but what should the root be ? and of course there’s no index in Consul, but it seems Nginx expects one ?

Hi @LudoEducatif!!
There is not very structured information about it. You must work with an application server like unicorn. First, make sure you have the gem installed:

$ gem list | grep unicorn

Visit this page, it can be of great help to guide you in the process:

RVM, Ruby on Rails, Unicorn y Nginx

Don’t forget to visit the Consul’s documentation, where is specified some prerequisites for the application to work correctly

Consul Documentation

Regards,
Sergio Turpín

Hi @sturpin, this time I’m done, before I had no idea that I had to use unicorn, though I knew it was there… After a bit of research about how to configure Nginx to work with Unicorn (especially this link helped me : https://launchschool.com/blog/setting-up-your-production-server-with-nginx-and-unicorn)… now my site is up and running !
Thank you for the help !

2 Likes

Great!! I’m very glad :wink:

Sergio Turpín

1 Like