SSL certificate configuration must be defined
- ssl_certificate /etc/nginx/certs/example.com.crt;
- ssl_certificate_key /etc/nginx/certs/example.com.key;
- ssl_dhparam /etc/nginx/certs/example.com.dhparam.pem;
We could have merged this configuration with the first one :
Redirect IP address to domain name
Of course your SSL certificate must be valid for the IP address
Main config catching https://www.example.com used as a reverse proxy here