【发布时间】:2016-04-24 13:21:59
【问题描述】:
我正在尝试重定向我网站上的子域。现在,我已将以下块添加到 /etc/nginx/nginx.conf 的文件中
server {
listen 80;
server_name notebook.mysite.com;
location / {
proxy_pass http://0.0.0.0;
}
}
这应该使访问 notebook.mysite.com 与访问 mysite.com 相同并显示主页。最终,我将添加一个端口,以便位置块包含 proxy_pass http://0.0.0.0:12345; 但是,当我访问 http://notebook.mysite.com 时,我的浏览器给了我错误
This site can’t be reached
notebook.mysite.com’s server DNS address could not be found.
DNS_PROBE_FINISHED_NXDOMAIN
任何人都知道这是为什么,或者至少我将如何解决它?
【问题讨论】:
-
0.0.0.0不是要连接的有效 IP。您想将其更改为http://localhost或http://example.com。