Using a traditional hard drive versus an SSD drive should not cause a 502 error. That’s not really plausible, as your question indicates @elopio.
Here is a little writeup which might be helpful:
The best thing to do, in my view, is to open up some terminals and run tail -f on your both your Rails and nginx log files, including the error logs and access logs; and then try to access and make sure when you see the 502 error you have your eyes on the tails of the log files.
Do you know where those logfiles reside and how to run tail -f commands on them in terminals?
Note, you asked earlier:
Rails run on port 3000 inside the Docker container and that port is not exposed outside the container. That is why you are not seeing port 3000 outside the container when you run netstat outside the container.
HTH