4

网站分站的技术实现

 8 months ago
source link: https://www.v2ex.com/t/1005041
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  问与答

网站分站的技术实现

  Dongxiaohao · 2 小时 8 分钟前 via Android · 682 次点击
op 看见有一些网站可以开通分站(主要是发卡网),就是用户输入一个二级域名,或者根域名后面拼一段唯一 ID ,用户付完款就可以直接通过子域名或者指定域名访问他开通的分站,并且在他后台可以对分站进行配置,比较好奇这种分站实现的技术原理。

1 、分站的子域名那种模式我的常规理解是去 nginx 配置域名,dns 配置解析之类的,如何实现动态自助就可以开通分站,并且可以访问的,还可以和用户绑定。

2 、域名固定后面加一个唯一路径我的理解就是这个唯一路径相当于一个 code 和用户那边绑定,网站内容会根据这个 code 在数据库查询用户的设置,动态加载内容?(本人拙见)

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK