自定义域设置godaddy和azure

时间:2017-08-09 07:39:04

标签: azure azure-web-sites

我有来自Godaddy的域名,托管来自Azure。

我想要自定义域名设置,我已阅读link

我的网站正在使用www.domainname.com和domainname.com开放 但是社交媒体没有用。

所以我的问题是在azure我添加了www.domainname.com或两者兼而有之?

如果我只添加domainname.com,那么nake domain将给出404错误

请帮帮我。 enter image description here enter image description here

1 个答案:

答案 0 :(得分:1)

  

所以我的问题是在azure我添加了www.domainname.com或两者兼而有之?

是的,您应该在Azure门户上添加这两个域。 Azure Web应用程序将检查主机名,并将其与Azure门户上设置的主机名进行比较。

此外,www CNAME记录应绑定到您的网络应用的默认域。例如,agentsdeal.azurewebsites.net

  

但我现在使用aspnet身份问题是如果我使用agentsdeal.com登录而不是登录www.agentsdeal.com我的东西azure正在为每个域制作不同的时刻

您需要在app.UseCookieAuthentication中设置CookieDomain,该文件写在Startup.Auth.cs文件中。以下代码供您参考。

app.UseCookieAuthentication(new CookieAuthenticationOptions
{
    AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
    LoginPath = new PathString("/Account/Login"),
    CookieDomain = ".agentsdeal.com"
});