我正在尝试在共享一个弹性 IP 的 EC2 实例上配置两个域。如果我在本地分配弹性 IP,两个域都可以正常工作/var/etc/hosts
。
我使用注册商的名称服务器,并将每个域名的 IP 放在那里。我假设我在 Nginx 配置的服务器块中做错了什么。
我的配置目前如下:
域 1:
server {
listen 80;
server_name domain-1.com;
include hhvm.conf;
root /var/www/domain-1.com/html;
index index.php;
location ~ \.(hh|php)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/domain-1.com/html$fastcgi_script_name;
include fastcgi_params;
}
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
}
域 2:
server {
listen 80;
server_name domain-2.com;
include hhvm.conf;
root /var/www/domain-2.com/html;
index index.php;
location ~ \.(hh|php)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/domain-2.com/html$fastcgi_script_name;
include fastcgi_params;
}
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
}