nginx stands between you and the application. This step shows where the 502 comes from.
nginx does not keep the shop's pages. It works as a reverse proxy: it takes the client's request, sends its own request to the application and passes the application's answer back to the client. The application behind a proxy is called the upstream. The request's path splits into two legs — client → nginx and nginx → application — each with a connection of its own.
The location block inside server says where to send the requests:
location / covers the paths that start with /, so any path. proxy_pass is the application's address: nginx will connect to 127.0.0.1, port 3000.
A 502 Bad Gateway answer means the first leg worked: nginx got the request and answered it itself. It got no answer from the application — the second leg broke. nginx writes why to error.log, in a line with the words while connecting to upstream.
Find where nginx connects
Request the site once more, read the last line of the nginx error log and see which ports on the machine are listening.