在一台vps上我跑了两个nginx的容器,同时指了两个域名到这个服务器,想这两个域名分别对应两个容器,怎样可以使这个两个域名不需要输入端口就可以直接访问
phpcn_u15822017-04-25 09:03:59
You need to run a real nginx (not nginx container) on this server as a reverse proxy. Configure two servers in this real nginx setting, then declare your two domain names respectively, and make the request Forwarded to nginx of both containers.
Please refer to this link for details
给我你的怀抱2017-04-25 09:03:59
Search for nginx multi-domain name configuration. In fact, just write a few more server_name
黄舟2017-04-25 09:03:59
One disadvantage of nginx without docker is that nginx cannot access static resources because the static resources are in docker.