I'm trying to add nginx mp4 and upload module via

./configure --add-module=/tmp/nginx-upload-module-2.2.0

but it gives this(below) error. Whatever i tried, couldn't install the zlib. I need help..

./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=<path> option.

when i try to install zlib via

sudo apt-get install zlib1g-dev and this time it gives below error.

Package zlib1g-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Edit : Ubuntu version :

Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial

Solution 1:

A little late though. I guess you will need to install all the dependencies with the package. Try running:

apt-get install libpcre3 libpcre3-dev zlib1g zlib1g-dev libssl-dev