With java spring boot it’s easy the write a web application. Standard this web application will run on port 8080. On GNU/Linux, ports below 1024 are priviliged ports, so a normal user can’t run a web application on ports below 1024.

So, I’ve set up nginx as a reverse proxy to make those web applications available on port 80.

How?

  • apt install nginx
  • edit /etc/nginx/sites-available/default
    server {
     listen 80 default;
     location / {
         proxy_set_header   X-Real-IP $remote_addr;
         proxy_set_header   Host      $http_host;
         proxy_pass         http://127.0.0.1:8080;
     }
    }