我正在开发一个基本上包含不同应用程序的平台:
首先,我专注于按子域划分事物,例如:
- https://login.mydomain.com => Login application for all users of the platform, (Uses IdentityServer 4, ASP CORE)
- https://root.mydomain.com => Administrative application (SPA)
- https://root.mydomain.com/api => API for administrative application (ASP Core)
- https://client1.mydomain.com => Client 1 Web Application 1 (SPA)
- https://client1.mydomain.com/api => API for client 1 web application (ASP Core)
- https://client2.mydomain.com => Client 2 Application (SPA)
- https://client2.mydomain.com/api => API for client 2 web application (ASP Core)
考虑到客户端1和客户端2的Web应用程序是相同的(数据访问更改),因此API也会发生相同的情况。
这种方法使https证书,OAuth2重定向,IdentityServer重定向等非常困难。
,您可以选择将子域中的应用程序与路由中的客户端分开:
- https://login.mydomain.com => Login application for all users of the platform, (Uses IdentityServer 4, ASP CORE)
- https://root.mydomain.com => Administrative Application (SPA)
- https://root.mydomain.com/api => API for administrative application (ASP Core)
- https://app.mydomain.com/client1 => Client 1 Web Application (SPA)
- https://app.mydomain.com/client1/api => API for client 1 web application (ASP Core)
- https://app.mydomain.com/client2 => Client 2 Web Application (SPA)
- https://app.mydomain.com/client2/api => API for Client 2 web application (ASP Core)
这使我产生了一系列疑问: