SSL Certifikát na DNS adresu.

Požiadavky:

  • Musíte mať doménu
  • Nainštalovať nginx
  1. Vyžiadajte certifikát
certbot certonly --webroot --agree-tos --email you@example.com -d wiki.ibasterisk.sk -w /var/www/html/

Úprava nginx

Choďte do priečinka nginx

cd /etc/nginx/conf.d

A upravte wiki.js.conf

nano wiki.js.conf

Upravte si server_name

Ssl_sertificate

Ssl_certificate_key

server {

    listen [::]:443 ssl http2;
    listen 443 ssl http2;
    listen [::]:80;
    listen 80;

    server_name wiki.ibasterisk.sk;

    charset utf-8;
    client_max_body_size 50M;

    ssl_certificate /etc/letsencrypt/live/wiki.ibasterisk.sk/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/wiki.ibasterisk.sk/privkey.pem;

    if ($scheme != "https") {
        return 301 https://$host$request_uri;
    }

    location / {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_next_upstream error timeout http_502 http_503 http_504;
    }

}
nginx -t
systemctl reload nginx