Diffie-Hellman key exchange is a popular cryptographic algorithm that allows Internet protocols to agree on a shared key and negotiate a secure connection. It is fundamental to many protocols including HTTPS, SSH, IPsec, SMTPS, and protocols that rely on TLS.
You can use any of the following guides to use either 2048 or 4096 bit key:
openssl dhparam -out /etc/nginx/ssl.crt/server.dh_pem 2048; echo "ssl_dhparam /etc/nginx/ssl.crt/server.dh_pem;" >> /etc/nginx/nginx-includes.conf /etc/init.d/nginx restart
openssl dhparam -out /etc/nginx/ssl.crt/server.dh_pem 4096; echo "ssl_dhparam /etc/nginx/ssl.crt/server.dh_pem;" >> /etc/nginx/nginx-includes.conf /etc/init.d/nginx restart
This is going to take a long time