Tuesday, January 17, 2017

nginx proxy https node express


server {
    listen 443 ssl;

    server_name domain.name.here.com;

    ssl_certificate /usr/local/etc/nginx/cert.crt;
    ssl_certificate_key /usr/local/etc/nginx/cert.key;

    location / {
        proxy_pass https://127.0.0.1:3000;
        proxy_set_header host $host;

        # proxy_connect_timeout       600;
        # proxy_send_timeout          600;
        # proxy_read_timeout          600;
        # send_timeout                600;
   }
}

To create a certificate in homebrew'd nginx:

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /usr/local/etc/nginx/cert.key -out /usr/local/etc/nginx/cert.crt

No comments:

Post a Comment