Try HTTPS in localhost

sudo apt-get install -y libnss3-tools


mkdir ~/mkcert && \ cd ~/mkcert && \ wget https://github.com/FiloSottile/mkcert/releases/download/v1.1.2/mkcert-v1.1.2-linux-amd64 && \ mv mkcert-v1.1.2-linux-amd64 mkcert && \ chmod +x mkcert


./mkcert -install


./mkcert localhost


ls -l


apt install -y nginx 

systemctl start nginx


/etc/nginx/sites-available/default

server {

    listen       80;

    server_name  localhost;

    return       301 https://$host$request_uri;

}

server {

    listen       443 ssl;

    server_name  localhost;

# SSL

    ssl_certificate       /<PATH TO Mkcert DIR>/localhost.pem;

    ssl_certificate_key   /<PATH TO Mkcert DIR>/localhost-key.pem;

location / {

        root   /usr/share/nginx/html;

        index  index.html index.htm;

    }

}


systemctl restart nginx


GO TO https://localhost/