让 Zuul 成为我应用程序的唯一入口点
Make Zuul the unique entry point of my application
我的应用程序在端口 8081 上包含一个名为 "service" 的服务,其中包含一些 API,例如
- localhost:8081/api/services
- localhost:8081/api/services/id
- ...
Zuul 运行 在端口 8761 上,我现在可以像那样访问这些 API
- localhost:8761/服务/api/services
- localhost:8761/服务/api/services/id
但是,仍然可以使用以前的 API(直接到服务)。怎么可能阻止它们,以使 Zuul 成为唯一的入口点?
如果您 运行 绑定到本地主机的服务只能从该框访问。您不需要做更多的事情。
我的应用程序在端口 8081 上包含一个名为 "service" 的服务,其中包含一些 API,例如
- localhost:8081/api/services
- localhost:8081/api/services/id
- ...
Zuul 运行 在端口 8761 上,我现在可以像那样访问这些 API
- localhost:8761/服务/api/services
- localhost:8761/服务/api/services/id
但是,仍然可以使用以前的 API(直接到服务)。怎么可能阻止它们,以使 Zuul 成为唯一的入口点?
如果您 运行 绑定到本地主机的服务只能从该框访问。您不需要做更多的事情。