When serving web applications from your own server (or a dedicated instance in the cloud) you might want to allow an access to the users from all around the world. Giving out an IP address does not look very professional so you choose to have an awesome domain. What if you have multiple domains, though? Let's configure nginx server so that you don't have to pay extra and have everything in the same place.
Having played with nginx both as a simple file server and a reverse proxy, it's time to explore another way it can easily improve your application. Using it as a load balancer can give your application a boost in the terms of availability, while not requiring that much of the configuration. Just take a look.
It's often assumed, that if you split a web application into a back-end API and front-end static files, you should have two separate servers for them. While this might be a good idea from an architectural point of view, you might want your end users to see the product as a whole. Fortunately, with nginx you can easily set up just that by making it act as a reverse proxy.
Whenever you are building a web application, you can generally divide it into two parts: a backend API, which is hosted on some specific application server and a front-end website that consists of static resources like HTML, Java Script and CSS. But how should you serve those files to make them accessible to the end user? One of more popular solutions is use nginx.