One reason is, you have multiple apps/websites hosted on the same server. Say you have a landing/marketing page at myproduct.com and a dashboard for user accounts at app.myproduct.com. They can't both listen port 80 (default http port). You set up a reverse proxy that listens to 80 and forwards traffic to the respective app based on the domain. The apps can listen to ports 3000 and 3001 for example.
I think so. Just so im sure i understood your explanation, internally they use 3000 and 3001, and when people hit up myproduct.com and app.myproduct.com, that goes to nginx which then forwards the request to the correct ports?
This is really interesting. Could you eli5 why one would need to use a reverse proxy at all?
This is a really nice article-
cloudflare.com/learning/cdn/glossa...
One reason is, you have multiple apps/websites hosted on the same server. Say you have a landing/marketing page at myproduct.com and a dashboard for user accounts at app.myproduct.com. They can't both listen port 80 (default http port). You set up a reverse proxy that listens to 80 and forwards traffic to the respective app based on the domain. The apps can listen to ports 3000 and 3001 for example.
Does that make sense?
I think so. Just so im sure i understood your explanation, internally they use 3000 and 3001, and when people hit up myproduct.com and app.myproduct.com, that goes to nginx which then forwards the request to the correct ports?
Correct!
awesome. thanks so much!