简体   繁体   English

使Zuul成为我应用程序的唯一入口点

[英]Make Zuul the unique entry point of my application

My application contains a service named "service" on port 8081 with some APIs like 我的应用程序在端口8081上包含一个名为“ service”的服务,其中包含一些API,例如

  • localhost:8081/api/services 本地主机:8081 / API /服务
  • localhost:8081/api/services/id 本地主机:8081 / API /服务/ ID
  • ... ...

With Zuul which run on port 8761, I can now access to these APIs like that 通过在端口8761上运行的Zuul,我现在可以像这样访问这些API

  • localhost:8761/service/api/services 本地主机:8761 /服务/ API /服务
  • localhost:8761/service/api/services/id 本地主机:8761 /服务/ API /服务/ ID

However, it is still possible to use the previous APIs (directly to the service). 但是,仍然可以使用先前的API(直接用于服务)。 How is it possible to block them, in order to make Zuul the unique entry point ? 为了使Zuul成为唯一的入口点,如何阻止它们?

If you run a service bound to localhost it is only accessible from that box. 如果运行绑定到本地主机的服务,则只能从该框中访问该服务。 You don't need to do any more than that. 您不需要做更多的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM