You must be wondering that you have heard of Nginx as a web server (ie. Apache) but A Proxy, what’s that ??
So, firstly who created NGINX Web Server?
–> Same developers who contributed to build Apache web server have built NGINX
Why NGINX ?
–> It was designed to overcome flows of Apache web server
–> It has a lot more functionalities and features to serve your web better and in a secure way
–> It is more than just a web server, a proxy as an example.
What are some benefits NGINX provides you?
- Do you want to throttle requests that are being made at very higher rate?
- Do you easily want to block some IPs who are requesting more than expected? (DDoS)
- Do you want to setup a reverse proxy where you need not to show your actual URL?
- Do you want to host multiple websites from same server?
- Do you want to manage user’s load
- Do you want to cache some objects to serve faster?
- Do you want to manipulate headers with REGEX?
All of the above can be achieved with NGINX. This is just to start with, Nginx can do many more things than this.
Let’s see some configuration examples for NGINX
- Basic Server Block
- This is where you will define rules for any port/server_name configurations
Comments specify how every location block behaves and for which purpose that can be used.