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