我有一个带有Hetzner的服务器,还有一些带有Google域的域。我的Apache服务器运行在端口80上,节点服务器运行在端口8080上。
如果我的服务器的IP是192.0.2.4,而我的域是example.com,我想要设置Google域,以便:
到目前为止,我在中添加了这些规则:
@ A 1h 192.0.2.4
www CNAME 1h example.com
a CNAME 1h ghs.googlehosted.com (added as a subdomain redirection from a.example.com to 192.0.2.4:8080)我有这样的行为:
我需要改变什么才能让它起作用?我需要在赫茨纳那边做点什么吗?
发布于 2018-07-02 15:16:33
问题是您将http://a.example.com重定向到http://192.0.2.4:8080。浏览器重定向会导致网页浏览器中的地址栏发生更改。
你可能想要的是:
a.example.com设置一个基于名称的额外虚拟主机a.example.com VirtualHost配置为端口8080上的节点服务器的反向代理。您可能需要一些额外的指令,但大致上您需要一些类似以下内容的内容:
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
DocumentRoot /var/www/html/
</VirtualHost>
<VirtualHost *:80>
ServerName a.example.com
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
</VirtualHost>https://serverfault.com/questions/919186
复制相似问题