Let you SSL score is A+

Let you SSL score is A+

Profile picture for user a65162

You need to create dhparams.pem file, so firstly type openssl dhparam -out dhparams.pem 4096 in the terminal.

When it completely generates, put dhparams.pem to /etc/letsencrypt/live/www.a-wei.tw and pastes below code to your configuration. That's all.

server {
        listen 443;
        listen [::]:443;
        ssl on;
        ssl_certificate /etc/letsencrypt/live/www.a-wei.tw/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/www.a-wei.tw/privkey.pem;
        ssl_dhparam /etc/letsencrypt/live/www.a-wei.tw/dhparams.pem;

        root /var/www/html/master/public;
        index index.php index.html index.htm index.nginx-debian.html;

        server_name www.a-wei.tw;

        location / {
                try_files $uri /index.php?$query_string;
        }

        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        }

        location ~ /\.ht {
                deny all;
        }

        # 以下可以省略,但是還是建議加上(最下方有連結說明移除 SSLv2, SSLv3)
        ssl_session_timeout 5m;
        ssl_session_cache shared:SSL:5m;

        #ssl_protocols SSLv3 TLSv1;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        #ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
         ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
  		ssl_prefer_server_ciphers on;
        add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
}

 

Related Posts