我已将 nginx 配置为代理,而 apache 正在监听端口 80。不知何故,似乎无法在 nginx 中区分域名。
Apache 配置:
<VirtualHost xx.xx.xx.xx:80>
ServerName staging.static.domain.com
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
ProxyPass / http://localhost:8000/
ProxyPassReverse / http://localhost:8000/
</VirtualHost>
<VirtualHost xx.xx.xx.xx:80>
ServerName staging.domain.com
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
ProxyPass / http://localhost:8000/
ProxyPassReverse / http://localhost:8000/
</VirtualHost>
nginx 配置
server {
listen 8000;
server_name "staging.static.domain.com";
}
server {
listen 8000;
server_name "staging.domain.com";
}
无论域名是什么,第一个服务器总是会被执行。
如何在不改变端口的情况下区分这两者?