基本上,我试图将我的域指向不同的 IP。
正在检查website/domain ,看来 DNS 已传播到新的 IP 地址。访问该网站时,我看到“欢迎来到 nginx!”信息。如果我直接加载IP - 209.105.244.90
,它会显示网站。我已经等待了超过 24 小时才发生更改 - 但没有运气。
我错过了什么? 任何帮助,将不胜感激。
以下是 nginx 配置:
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server {
listen 80;
server_name 209.105.244.90;
root /home/firemonk/myapps/web/public; # <--- be sure to point to 'public'!
passenger_enabled on;
}
最佳答案
你的第一个服务器 block 有
server_name localhost;
你的第二个服务器 block 有
server_name 209.105.244.90;
换句话说,您的服务器 block 都没有设置为监听您的域名 -> 将您的域名添加到相关服务器 block
关于dns - DNS 更改后 Nginx 出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12986140/