路由到URL在配置

时间:2019-12-06 20:38:29

标签: spring-cloud spring-cloud-gateway

我试图熟悉spring-cloud-gateway,但在YAML中配置路由时遇到问题。我正在尝试基于httpbin.org的路径进行简单的重定向。当我在代码中执行此操作时,此方法很好,但是当我在YAML配置中尝试执行此操作时,我得到了404。 YAML:

  -  id: demo
         uri: http://httpbin.org
         predicates:
         - Path=/demo

当我尝试此路线时,看起来路线已匹配-我没有看到该路线本身的404。我得到的回应是

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try
    again.</p>

我在这里做什么错了?

0 个答案:

没有答案