I'm trying to compile nginx from source with the SSL module enabled. When I run this command:

./configure --with-http_ssl_module

it does its usual checks to see if everything is installed correctly, and then this pops up:

checking for OpenSSL library ... not found

./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.

I know for a fact that OpenSSL is installed, because when I do openssl version I get OpenSSL 1.0.1 14 Mar 2012

So I'm pretty stumped. I thought maybe OpenSSL isn't isntalled in its default location, which is why nginx can't find it, but I have no idea where this is as it came pre-installed with the server. How can I find out where this is?

The server is running Ubuntu 12.04 LTS.


  • 2
    For people using yum (CentOS | redhat | fedora) try installing openssl-devel and then try running the command. – maverick3 Feb 4 '15 at 7:24

Most likely you're missing the libssl-dev package.

But why not save yourself all the trouble and just use a PPA for nginx?

  • What exactly are PPA's? From what I can gather people can upload packages to be installed using apt-get? I thought the best way to ensure I was always getting the latest version of software was to compile it from the source from the website. – James Linton Aug 11 '12 at 18:42
  • 1
    PPAs are Personal Package Archives. As you said, they are to distribute dpkg packages. Compiling from source might get you the newest version but this is not always necessary. Information for Ubuntu and the PPA can be found here: wiki.nginx.org/Install#Official_Debian.2FUbuntu_packages – Christopher Perrin Aug 11 '12 at 19:29
  • The info on the nginx wiki is good. It will eventually lead you to the PPA that I linked. :) – Michael Hampton Aug 11 '12 at 19:43
  • Alright thanks, I'll look into using PPA's in the future. But for this problem, installing libssl-dev worked. :) – James Linton Aug 11 '12 at 21:05
  • The Nginx PPA is the way to go as it provides the latest official Nginx binary through apt. Ubuntu typically provides an Nginx version a few releases back for support purposes, but using the Nginx PPA, you can get the latest release from Nginx.org. Much easier to use this approach over compiling from source & great for automated provisioning scripts. It keeps your apt on your system aware of the Nginx version currently installed making apt-based updates much easier. Unless there is a specific reason to compile from source, the PPA approach is so much easier to maintain in production. – Joe J Aug 22 '15 at 16:09

In case you want to check that libssl is installed in the right place, you can type which openssl and then ldd /path/to/openssl.


I used the following to get openssl for nginx:


All other attempts either did not work, or were to clunky.

Hope this helps another...


Even when OpenSSL is already installed (brew install openssl), configure itself suggests a workaround, which worked for me:

./configure --with-http_ssl_module --add-module=../nginx-rtmp-module-master--with-openssl=~/GitHub/openssl/openssl

  • Is the option --with-openssl= pointing at a cloned openssl github repo? You might consider editing your answer to reflect this as it could be confusing for people without sufficient understanding. – Jamie Lindsey Feb 9 at 8:37
  • yes, /GitHub/openssl/openssl is a cloned repository of github.com/openssl/openssl.git – Pnemonic Feb 9 at 18:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.