Question

I encounter error when service nginx reload

  • Posted October 15, 2021
  • Nginx

i am trying to implement an SSL to the IP but i encounter an error when i run service nginx reload

Job for nginx.service failed because the control process exited with error code. See “systemctl status nginx.service” and “journalctl -xe” for details.

and then when i run, sudo nginx -t

nginx: [warn] the “ssl” directive is deprecated, use the “listen … ssl” directive instead in /etc/nginx/sites-enabled/digitalocean:33

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Thank you very much for the help

Its all work fine now

Hello,

In order to fix the warning you need to open the /etc/nginx/sites-enabled/digitalocean file, and change the following:

  • Find this line:
listen 443;
  • And change it to:
listen 443 ssl;

Then on line 333 comment out the ssl on; line by adding a # before it as follows:

# ssl on;

Or delete the line completely.

Before making any changes, make sure to backup your config in case that you need to rever back to the previous version of the config file.

Also if Nginx is still not starting, make sure to check he Nginx error log:

tail -100 /var/log/nginx/error.log

Feel free to share the log here.

Best, Bobby