Search code examples
ruby-on-railssslnginxhttpsdnsimple

having to manually add 'https://' to a url


I have just added ssl to a VPS I'm running (first time so sorry if this is a newb thing to ask).

The SSL is working fine but I noticed when navigating to the URL from anywhere but my development machine, I have to manually add the https:// to the start of the url.

would anybody happen to know what may be causing this?

I'm using nginx on ubuntu 14.04 and dnsimple for my DNS records.

Any help would be much appreciated and if you need any more info let me know.

Thanks


Solution

  • You have to do a redirect http to https.

    An example:

    server {
        listen         80;
        server_name    my.domain.com;
        rewrite        ^ https://$server_name$request_uri? permanent;
    }