Last Updated: February 25, 2016
·
527
· zerocool51

Nginx https

Configuring nginx to use https and use a self-signed certificate (good for testing purposes).

Bash:

openssl req -new -x509 -days 1826 -nodes -out server.crt -keyout server.key

nginx configuration:

server {

        server_name your_domain;
        listen 443 ssl;
        root /path/to/root;
        index index.php index.html;
        ssl on;
        ssl_certificate /path/to/server.crt;
        ssl_certificate_key /path/to/server.key;

}