Table of contents

nginx configure error the HTTP gzip module requires the zlib library

Nginx Jul 25, 2020 Viewed 4.2K Comments 0


Download the nginx source code and configure, run the following commands.

$ wget
$ tar xf nginx-1.19.1.tar.gz
$ cd nginx-1.19.1
$ ./configure --prefix=/opt/nginx

But I get the error message saying:

checking for zlib library ... not found

./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using --without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using --with-zlib= option.


It requires zlib-devel package.

1.Install manually

On the web page, find the zlib-devel version that matches your operating system, and download and install it.

2. With command line


sudo apt-get install zlib1g-dev


sudo yum install zlib-devel
Updated Jul 25, 2020