Rate This Document
Findability
Accuracy
Completeness
Readability

ngx_http_ssl_module Is Not Added When Compiling Nginx

Symptom

When an uncompiled module is added to a compiled and installed Nginx, a message is displayed indicating that ngx_http_ssl_module is not added.

The message is as follows:

nginx: [emerg] the "ssl" parameter requires ngx_http_ssl module in /usr/local/nginx/conf/nginx.conf:100

In this example, the Nginx installation directory is usr/local/nginx and the source package is stored in /home/nginx-1.14.2.

Key Process and Cause Analysis

Nginx does not have http_ssl_module. You can solve this problem by adding the --with-http_ssl_module configuration during compilation and installation.

Conclusion and Solution

  • Method 1:
    1. Check the original Nginx modules.
      /usr/local/nginx/sbin/nginx -V

    2. Add http_ssl_module.
      ./configure  --with-http_ssl_module
    3. After the configuration is complete, compile Nginx.

      Do not run the make install command. The command is used to overwrite installation. Run the following command to back up the installed Nginx:

      cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
      make
    4. Stop Nginx.
      /usr/local/nginx/sbin/nginx -s quit
    5. Replace the original Nginx with the compiled Nginx.
      cp ./objs/nginx /usr/local/nginx/sbin/

      When a message is displayed indicating whether to overwrite Nginx, enter yes.

    6. Start Nginx and check whether http_ssl_module is successfully added.
      /usr/local/nginx/sbin/nginx -V
  • Method 2: Add http_ssl_module, and recompile and install Nginx.
    1. Run the configure script.
      ./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gzip_static_module --with-http_perl_module --with-pcre  --with-openssl=/home/openssl-1.1.1a
    2. Compile and install Nginx.
      make -j80 && make install