Then let’s go back to our top level custom NGINX directory;
Then let’s build our package. This might take a while. If you get a question during installation on whether to “Use the available Release binaries?”, just say Y.
sudo dpkg-buildpackage -b
When the build is finished we go up a level to our top level custom_nginx folder;
There should be several NGINX debian packages in this folder now.
Let’s install our custom full version (choose the version that matches your Ubuntu version);
sudo dpkg --install nginx-full_1.10.3-0+xenial0_amd64.deb
That’s it! Our custom NGINX build is now installed.
... read the whole story at medium.com.