gpt4 book ai didi

node.js - 如何允许客户在服务网站上为自己的页面设置自定义域?

转载 作者:行者123 更新时间:2023-12-05 00:56:39 25 4
gpt4 key购买 nike

我想实现相同的功能 Intercom提供给他们的客户;它们允许执行 Custom Domains for Articles .我不太清楚他们是如何实现他们的方法的,或者他们在幕后做了什么。

以下面的场景为例;一个客户(NorthWind 公司),在我公司的网站 (northwind.example.com) 上有一个子域。

会发生以下情况:

  • 如果用户键入 northwind.example.com,他们会转到 northwind.example.com 并且 northwind.example.com 会出现在网址栏。
  • 如果用户键入 example.northwind.com,他们会转到 northwind.example.com 并且 example.northwind.com 会出现在网址栏。

Intercom 实现它的方式与我希望实现它的方式之间的区别在于,我使用的是子域,而不是目录,如上面链接的 Intercom 帮助文章中所示。 p>


考虑到我的网站在 Nginx、NodeJS 和 MongoDB 上运行,这是我目前的想法:

  • 客户在其域名提供商上注册 CName 记录以指向他们在我网站上的页面。
  • 客户向我的网站提供他们使用的 CName 记录(通过表单注册)。
  • 我在 MongoDB 中为公司及其自定义域保存了一条记录。
  • 我使用 redbird 注册或重新注册我网站的反向代理允许重定向通过。

我已经查看了 Redirect Web Page to Another Site Without Changing URLDoes a Cname Change the URL that the Browser Displays .

我是在正确的道路上,还是有更好的方法?

最佳答案

我决定通过他们的支持 channel 向 Intercom 本人寻求答案,我得到了以下答复:

This isn't actually something we do anything too special with, it is all to do with the configuration of the web server, both on our side and the side of the client.

This stackoverflow goes into more details on this, but keep in mind that whilst it is a ruby StackOverflow - it focuses on the web server set up, in this case nginx - but it could be any web server software.

How to preserve request url with nginx proxy_pass

This then allows your service to receive the requests, but also have access to the original server address - we then ask our customers to provide the custom domain they are using within their Article Setting to help us translate the server address to the correct help center.

I do hope this helps, if you do have any follow up questions I'm happy to try and help, but as you mentioned this does fall out of the scope of our team so the help I can provide may be limited.

对我的 react 非常满意,因为他们超越了我。基本上,我走的路是正确的。我决定留下这个问题来帮助别人。我还发现了以下相关问题:

祝找到这个的人好运。

关于node.js - 如何允许客户在服务网站上为自己的页面设置自定义域?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62172415/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com