多子域应用设计

发布于 2024-10-21 09:04:57 字数 477 浏览 2 评论 0原文

过去,我只构建了为一位客户提供服务的 Web 应用程序,因此它们非常简单易用。现在,我想构建一个应用程序,多个客户可以在我的域的子域上托管他们自己的内容/网站,就像 blogspot.com 一样。因此,每个客户都会有自己的网站,例如 user1.myapp.com、user2.myapp.com 等。在每个客户的网站中,他们可以通过我的应用程序构建他们想要的任何内容,甚至在 URL 中添加更多级别,例如user1.myapp.com/custom - user1.app.com/custom 将显示与 user2.app.com/custom 完全不同的内容。我对如何实现这一目标感到非常困惑。有人可以从一般意义上向我描述一下,我们如何从访问 user1.myapp.com/custom 的人那里获取为 user1 提供实际正确自定义页面的应用程序?我们如何将 URI 映射到正确的用户内容?我们实际上仍然托管真实页面(由用户组织),还是只是动态生成内容?需要什么类型的设计/架构来支持这一点?如有任何帮助,我们将不胜感激。多谢。

In the past, I've only build web applications that serve one customer so they've been pretty simple and easy. Now, I'd like to build an application where multiple customers are able to host their own content/websites on subdomains of my domain, much like blogspot.com. So each customer will have their own site like user1.myapp.com, user2.myapp.com, etc. Within each of the customer's site, they can build whatever content they want through my application and even add more levels in the URL, like user1.myapp.com/custom - user1.app.com/custom will show totally different stuff than user2.app.com/custom. I'm quite lost at how to achieve this. Can someone describe to me in a very general sense, how do we get from someone accessing user1.myapp.com/custom to my application serving the actual correct custom page for user1? how can we map the URIs to correct user content? do we actually still host real pages (organized by user), or we just generate content on the fly? what type of design/architecture is needed to support this? any help at all is appreciated. thanks a lot.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我不咬妳我踢妳 2024-10-28 09:04:57

比那简单一点。一个想法是这样的:
将您的应用程序复制到每个用户的文件夹中,并将子域分配给该文件夹。
但是当您更新应用程序时,此拱门可能会出现问题,因为您必须更新所有应用程序。

It's a bit simpler than that. one idea is like this:
copy your application in each user's folder and assign the sub-domain to this folder.
but this arch may have problem when you update your application because you must update all applications.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文