4minitz icon indicating copy to clipboard operation
4minitz copied to clipboard

HTTPS connection to my 4minitz Server

Open maxigrifone opened this issue 6 years ago • 6 comments

Hi everybody

You've probably already answered this question somewhere, but I couldn't find it. Is there a way for me as the server host, to make the 4minitz site connect to with https?

maxigrifone avatar Jan 18 '19 13:01 maxigrifone

Hi @maxigrifone,

sure that's possible (we have done this for our demo server, too. See #43). To establish an TLS encrypted connection you first need a specific domain (or subdomain) for your 4minitz instance (e.g. 4minitz.myserver.de). Therefore you have to configure a reverse proxy on a web server (nginx or apache).

Then you need a certificate for your domain (or subdomain). You can get one by using https://letsencrypt.org/ for example. Then you have to configure your web server to encrypt the connection using the certificate. Maybe the documentation of https://letsencrypt.org/ could be useful for this step 🤔

I hope this will help you. Maybe @derwok has some additional tips for you. If you need further help please tell us more about your infrastructure.

Here is a blog post about SSL and Meteor.js (Meteor is the framework 4minitz is built with). Maybe this could be useful.

Thanks for using 4mintz :-) !

Felix

felixble avatar Jan 18 '19 18:01 felixble

Thanks for using 4mintz :-) !

Thank you for the quick answer! I'll try that. Best regards Maxi

maxigrifone avatar Jan 19 '19 10:01 maxigrifone

Yes - reverse proxy is the key word here.

If you use nginx web server (strongly recommended), then look here: https://stackoverflow.com/questions/30815226/how-to-set-up-a-meteor-server-on-https-connection

derwok avatar Jan 20 '19 10:01 derwok

Yes - reverse proxy is the key word here.

If you use nginx web server (strongly recommended), then look here: https://stackoverflow.com/questions/30815226/how-to-set-up-a-meteor-server-on-https-connection

Thank you very much! I was able to configure an apache proxy, but unfortunately it only display a blank screen when i connect. I'll try it with nginx. Are you using nginx as a reverse proxy just like in https://stackoverflow.com/questions/30815226/how-to-set-up-a-meteor-server-on-https-connection? Or do I need special settings, because it's running in docker?

maxigrifone avatar Jan 20 '19 17:01 maxigrifone

With nginx this config worked multiple times:

    # pass all requests to Meteor
    location / {
        proxy_pass http://127.0.0.1:3100;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade; # allow websockets
        proxy_set_header Connection $connection_upgrade;
        proxy_set_header X-Forwarded-For $remote_addr; # preserve client IP

        # this setting allows the browser to cache the application in a way compatible with Meteor
        # on every applicaiton update the name of CSS and JS file is different, so they can be cache infinitely (here: 30 days)
        # the root path (/) MUST NOT be cached
        if ($uri != '/') {
            expires 30d;
        }
    }

derwok avatar Mar 17 '19 19:03 derwok

Hello,

I have the same need but i'm using 4minitz with docker container Could you please tell me how can i configure https in ? Thanks

elkham avatar Jul 24 '20 07:07 elkham