I have three web-apps on one server: two nodejs apps and one php. Now I don’t use containers, so the flow is following:
One Nginx is running. It select backend and static files dir by hostname. E.g. if I go to
mysite.com it proxy requests to
localhost:3000 and use static files from
/sites/mysite/static. If I go to
sistersite.com nginx proxy requests to PHP and use static files from
/sites/sistersite.com and so on.
Now I want to isolate applications and try Docker. Should I include Nginx to each container and resolve hosts-to-container by some router or should I include only application and use common Nginx installed to the host machine? If second, how to return static files? By adding root
/path/to/static/in/container? Sites also support both http and https, so they use different certificates.