3

我有 www.exampledomain1.com、www.exampledomain2.com,我在 VPS IP:11.22.333.444(示例)和 nginx 上构建站点。

我做了什么:

对于 www.exampledomain1.com : DNS 设置:

Type    Host                    IP
 A     www.exampledomain1.com   11.22.333.444

Nginx 设置(短):

server{
       server_name  www.exampledomain1.com;
}

对于 www.exampledomain2.com : DNS 设置:

Type    Host                    IP
 A      www.exampledomain2.com  11.22.333.444

Nginx 设置(短):

server{
       server_name  www.exampledomain2.com;
}

我的想法是:当 www.exampledomain1.com 在浏览器中触发时,我的 nginx 正在接收“主机”(server_name www.exampledomain.com),然后从正确的根目录启动我的网站。我做错了什么?

4

0 回答 0