I
I
Ivan2018-12-06 02:37:23
Nginx
Ivan, 2018-12-06 02:37:23

How to generate and connect an ssl certificate in nginx?

How to generate and connect an ssl certificate in nginx?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem, 2018-12-06
@ber_enot

The easiest way to get a certificate is from Let's Encrypt .
The instruction is here: https://certbot.eff.org
Select the server (nginx) and OS, the instruction opens.
Here is an example for debian 9:
https://certbot.eff.org/lets-encrypt/debianstretch...
And here is the host configuration:

server {
    listen 443 ssl default_server;
    server_name my-domain;
    
    ssl_certificate /etc/letsencrypt/live/my-domain/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/my-domain/privkey.pem;
  
    # ...
}

This is simplified. It will work, but read more about configuring HTTPS in nginx.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question