nginx configure for https code example
Example 1: nginx listen on 80 and 443
server {
listen 80;
listen 443 default_server ssl;
# other directives
}
Example 2: nginx local setup https
$ openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -keyout localhost.key -out localhost.crt