Clone the source code from github
git clone https://github.com/nginx/nginx.git
Run the configure script, you can decide which modules are needed, you can configure the installation path with — prefix flag. Be carefull and don’t use the root partioning :) you can fill up!
./auto/configure --prefix=/home/usr/opt
Run make
make
Here is the nginx bin file.
./objs/nginx
You can run nginx without root permission. Please change the port inside conf file /home/usr/conf/nginx.conf
Some conf tips:
master_process off // no fork for working process, nginx has a one process, single processdaemon off // no background--with-openssl-opt='-d' // if you want to have openssl with debug mode