nginx-ssl-reverse-proxy

This is a very minimalistic reverse-proxy setup with SSL.

Create a certificate and key using below command. Set env variables in advance:

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout $private_dir/nginx-selfsigned.key -out $cert_dir/nginx-selfsigned.crt

Keep the certificate generated in the certs directory and the key generated in private directory.

The actual setup goes here:

NGINX configuration file

A working front-end with SSL and reverse proxy running on port 443:

Working backends on HTTP:

Backend 1 running on port 8090:

Backend 2 running on port 8095:

Reverse proxy in action for backends:

Backend 1 through reverse-proxy over HTTPS:

Backend 2 through reverse-proxy over HTTPS: