How To Create a Self-Signed SSL Certificate for Nginx on debian
How to Create a SSL Certificate on ezeelogin jump server for Nginx on debian 8
Create a Self Signed Certificate
When we request a new certificate, we can specify how long the certificate should remain valid by changing the 365 to the number of days we prefer. As it stands this certificate will expire after one year.
Common Name (e.g. server FQDN or YOUR name). You need to enter the domain name associated with your server or, more likely, your server’s public IP address.
ssl_certificatedirective to our certificate file and the
ssl_certificate_keyto the associated key. In our case, this will look like this:
When you’ve added those lines, save and close the file.
Adjust the Nginx Configuration to Use SSL
Before we go any further, let’s back up our current server block file:
[email protected]:~# sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/default.bak
Open the server block file to make adjustments
listen 80 default_server;
listen [::]:80 default_server;
return 302 https://$server_name$request_uri;
# SSL configuration
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
. . .
Your virtual host is now all set up! Save and Exit