HTTP Server: NGINX

SSL Support (HTTPS)

by ross at 08:36:13 on August 2, 2014

If self-signed certificate is enough for you, then you can generate one using this guide.

You can add https support for any existing NGINX port-80 server. In order to do so replace this line:

    listen       80;

with this:

    listen       80;
    listen       443 ssl;

    # Your certificate and the key here:
    ssl_certificate      /etc/certs/example.com.crt;
    ssl_certificate_key  /etc/certs/example.com.unencrypted.key;

    ssl_session_cache    shared:SSL:1m;
    ssl_session_timeout  5m;

    ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers  on;

No need to change anything else in this server configuration.

Restart NGINX:

# service nginx restart

 

Comments