Setup Nginx server in linux

Installation

By default, Nginx will be installed in /usr/local/nginx.

./configure  
make  
make install  

Configuration

The configuration file is /usr/local/nginx/conf/nginx.conf.
Here is an
excellent simple tutorial, and here
is a full example.
If you want to show all the files in the root directory, you can turn
on autoindex like this:

location / {  
    autoindex on;  
    root /home;  
}  

Running Nginx

/usr/local/nginx/sbin/nginx          //start nginx  
/usr/local/nginx/sbin/nginx -s quit  //stop nginx  

Problems

If you do not need the rewrite module and gzip module, you can ignore the
errors with PCRE and gzip when configuring.

References

Install - Nginx Community
Nginx Configuration Primer