nginx the "ssl" directive is deprecated, use the "listen ... ssl"

sambua picture sambua · Aug 6, 2018 · Viewed 60.7k times · Source

After NGINX upgrade to v1.15.2 starts getting the warning.

nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /usr/local/etc/nginx/sites-enabled/confid-file-name:8

Where the 8th line is ssl on;

Answer

Thanh Nguyen Van picture Thanh Nguyen Van · Aug 6, 2018

Edit your listen statement from:

listen 443;

to

listen 443 ssl;

and comment out or delete :

# ssl on;   

then check nginx -t again.