openssl genrsa 2048 > edgenode1.key
openssl req -new -x509 -nodes -sha1 -days 3650 -key edgenode1.key -subj "/C=JO/CN=*.goll.com"> edgenode1-wildcard.cert
cat edgenode1-wildcard.cert edgenode1.key > edgenode1-wildcard.pem
chmod 644 edgenode1.key edgenode1-wildcard.pem
mkdir /etc/nginx/ssl
cp edgenode1.key edgenode1-wildcard.pem /etc/nginx/ssl
vim /etc/nginx/conf.d/ssl.conf
server {
listen 443;
server_name *.goll.com;
ssl on;
ssl_certificate /etc/nginx/ssl/edgenode1-wildcard.pem;
ssl_certificate_key /etc/nginx/ssl/edgenode1.key;
ssl_session_timeout 5m;
}
=== or 2 files in one command:
openssl req -subj "/C=JO/CN=*.goll.com" -x509 -nodes -days 365 -newkey rsa:2048 -keyout nginx-selfsigned.key -out nginx-selfsigned.crt