./configure: error: SSL modules require the OpenSSL library

Fix the 'SSL modules require OpenSSL library' error when compiling NGINX. Learn solutions for Debian/Ubuntu and CentOS/RedHat. Fast and effective!

While compiling the NGINX web server, we may run into several errors, mainly resulting from missing developer libraries; here's one of them:

./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl= option.

To eliminate the above error, we install the following package:

  • Debian/Ubuntu : aptitude install libssl-dev
  • RedHat/CentOS : yum install openssl-devel.x86_64