All Products
Search
Document Center

Certificate Management Service:Issues related to http_ssl_module of NGINX and solutions

Last Updated:Apr 21, 2025

NGINX servers use the http_ssl_module module to load SSL certificates. Before you install a certificate on your NGINX server, you must make sure that the server includes the module.

Common errors

Error 1: the "ssl" parameter requires ngx_http_ssl_module

Cause: The NGINX server is not compiled with the http_ssl_module module.

Error 2: nginx: [emerg] unknown directive “ssl” in /usr/local/nginx/conf/nginx.conf

Cause: After you modify the configuration file of the NGINX server and run the nginx -s reload command, if the preceding error appears, the current version of NGINX is not compiled with the http_ssl_module module.

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

Cause: The OpenSSL dependency library is missing.

Solutions

Check whether OpenSSL is installed on the server. If the NGINX server is not compiled with the http_ssl_module module, recompile the NGINX server to include the http_ssl_module module.

Examples

Note

In this example, an NGINX 1.14.1 server that runs a 64-bit CentOS 8.0 operating system and has OpenSSL 1.1.1k installed is used. This example is for reference only. We recommend that you select a compatible OpenSSL version based on your NGINX version.

  1. Check whether the current NGINX version includes the http_ssl_module module.

    1. Run the following command to check the compilation parameters of NGINX:

      nginx -V | grep http_ssl_module
    2. If the output includes --with-http_ssl_module, the http_ssl_module module is included. Otherwise, the http_ssl_module module is not included, and you must manually install the module.

      image

  2. Install the http_ssl_module module.

    # For CentOS, OpenSSL 1.1.1k version. Please choose a compatible OpenSSL version based on your Nginx.
    sudo yum install openssl-devel-1.1.1k
  3. Configure and compile the http_ssl_module module.

    # Go to the Nginx installation directory (example directory, please replace with your actual Nginx installation directory)
    cd /usr/local/nginx/
    # Configure http_ssl_module, other parameters can be customized
    ./configure --with-http_ssl_module
    # Compile
    sudo make 
    Important

    Do not run the make install command. Otherwise, the original NGINX configuration is overwritten.

  4. Check whether the http_ssl_module module is successfully installed. If not, repeat Steps 2 and 3.

    nginx -V | grep http_ssl_module
  5. Restart the NGINX service.

    # Go to the executable directory of the Nginx service (example directory, please use the actual path).
    cd /usr/local/nginx/sbin
    # Reload the configuration file.
    ./nginx -s reload