首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何防止在Google Cloud DNS上的url中子域名URL不更改为IP地址?

如何防止在Google Cloud DNS上的url中子域名URL不更改为IP地址?
EN

Stack Overflow用户
提问于 2019-03-14 21:49:28
回答 1查看 351关注 0票数 0

站点在http://magento.ngstorefront.com加载,但url更改为http://35.193.85.53。Siteground支持人员说,我们需要在Google Cloud DNS中管理这一点,而不是通过它们。如何才能使url不更改为IP地址?

详情:

Google Cloud VM --> http://35.193.85.53 (静态IP..此url上的站点加载)

我们的主域ngstorefront.com托管在Siteground.com上

为了使子域http://magento.ngstorefront.com指向35.193.85.53,我们在Siteground中添加了A和CNAME记录,如下所示:

magento.ngstorefront.com.   A   35.193.85.53
www.magento.ngstorefront.com.   CNAME   magento.ngstorefront.com  
EN

回答 1

Stack Overflow用户

发布于 2019-03-15 04:24:32

Siteground是错的。

DNS服务器的工作之一是将DNS名称转换为IP地址。

您的web服务器正在重定向。使用curl向您的供应商证明这一点。

这是一个简单的配置文件修复。

在我的回答中,请注意您的web服务器返回的302。请注意Location: http://104.197.44.78/index.php/?SID=fmn3h9n2qjhjplchl1070rgff6

您的Your服务器正在将http://magento.ngstorefront.com重定向到http://104.197.44.78/index.php/?SID=fmn3h9n2qjhjplchl1070rgff6

运行以下命令重复执行以下操作:

curl -i http://magento.ngstorefront.com

返回的结果如下:

HTTP/1.1 302 Found
Date: Thu, 14 Mar 2019 20:20:24 GMT
Server: Apache
Set-Cookie: store=default; expires=Fri, 13-Mar-2020 20:20:24 GMT; Max-Age=31536000; path=/index.php/; HttpOnly
Set-Cookie: PHPSESSID=fmn3h9n2qjhjplchl1070rgff6; expires=Thu, 14-Mar-2019 21:20:24 GMT; Max-Age=3600; path=/; domain=magento.ngstorefront.com; HttpOnly
Expires: Wed, 14 Mar 2018 20:20:24 GMT
Cache-Control: max-age=0, must-revalidate, no-cache, no-store
Pragma: no-cache
Location: http://104.197.44.78/index.php/?SID=fmn3h9n2qjhjplchl1070rgff6
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Content-Length: 0
Content-Type: text/html; charset=UTF-8
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55164229

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档