Nginx is primarily designed as a reverse proxy and can add a lot of value if placed in front of your applications: HTTPS termination HTTP2 termination WAF protection DOS protection Caching Basic/Digest Authentication Let’s see how we can setup a basic Java API webapp behind Nginx server { # custom virtual host root folder root /var/www/mydomain.com/web/; # index file (when a folder URI is matched)
![Nginx by examples: reverse proxy](https://cdn-ak-scissors.b.st-hatena.com/image/square/16d97a67eff4c009f2ca87518835137abd28717c/height=288;version=1;width=512/https%3A%2F%2Flightning.svbtle.com%2Fcargo%2Ficons%2Fsvbtle_logo-aca55ad0def32402ac3c38383f942d9cabaa9fbc46db7c7b12a6bc9d8c89fcc4.png)