Nginx is a much lighter web server than Apache. This web server has become quite popular in the recent years. The Apache web server can be quite complex to configure and use.



Nginx (pronounced "Engine X") is a high performance web server. It was originally developed to tackle the 10K problem which means serving 10,000 concurrent connections. Nginx can be used as a standalone web server, or serve in front of other web servers as a reverse proxy.



When serving as a reverse proxy, Nginx is acting as a front web server which passes the incoming requests on to web servers on the back, on different ports etc. Nginx can then handle aspects like SSL / HTTPS, GZip, cache headers, load balancing and a lot of other stuff.



The web servers on the back then do not need to know how to handle this. And - you only have one web server for which you need to learn how to configure SSL / HTTPS, GZip etc. - and that is Nginx. I use Nginx in front of Jetty. Nginx handles all the SSL / HTTPS stuff, and Jetty just serves ordinary HTTP requests on the back.




1.Installaion

------------------

Shutting down apache2 first before installing nginx should fix this problem:

sudo service apache2 stop


-Install

apt-get install nginx



-Starting Nginx

/etc/init.d/nginx start



-check status

http://localhost:80/

[or] -  htop

[or] -  ps –ef | grep nginx



-Restarting Nginx

/etc/init.d/nginx restart



-The Nginx main configuration file is located at:

/etc/nginx/nginx.conf


By default, the nginx configuration file can be found in:

/etc/nginx/nginx.conf,

/usr/local/etc/nginx/nginx.conf, or

/usr/local/nginx/conf/nginx.conf


----------------------------

2.Deploying Website

-----------------------



1. Simple HTML Application


Go to : /var/www/html

Copy html files