configure nginx as reverse proxy for pm2 and tomcat

Job ID: 31032415

Budget: $10 – $30 USD

I have the frontend on PM2 running on port http://127.0.0.1:4000
I have the backend api running at http://127.0.0.1:8080/server

Now nginx works as a reverse proxy and can read https://127.0.0.1 from http://127.0.0.1:4000 with the following settings

location / {
proxy_pass http://127.0.0.1:4000;
}

I need to do the same for port 8080.