docker - 一台服务器,两个部署了nginx的容器,解析了两域名,想分别访问这两个容器不添加端口?
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-04-25 09:01:59
0
5
959

在一台vps上我跑了两个nginx的容器,同时指了两个域名到这个服务器,想这两个域名分别对应两个容器,怎样可以使这个两个域名不需要输入端口就可以直接访问

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(5)
phpcn_u1582

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

某草草

Search nginx configuration server_name

巴扎黑

I don’t know if this can help you
/a/11...

给我你的怀抱

Search for nginx multi-domain name configuration. In fact, just write a few more server_name

黄舟

One disadvantage of nginx without docker is that nginx cannot access static resources because the static resources are in docker.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template