我是祖尔服务器的新手。我有一个遗留系统,我试图扼杀使用zuul代理服务器。我的zuul服务器正在本地机器上运行,我的带有spring安全性的遗留spring系统运行在专用的物理tomcat服务器(例如。http://test-server.domain.com/legacySystem)。当我输入带有某些路径的本地代理服务器URL时(例如。在浏览器地址栏中,我看到zuul服务器地址(不是原始服务器地址)。没关系。但是,在当前窗口中,当我尝试登录并将数据发布到服务器时,zuul将我重定向到原始服务器,然后在浏览器地址栏中看到http://test-server.domain.com/legacySystem/login;jsessionid=7152B389D11583056C702BEB0BA20232地址。登录post后的服务器返回代码302。我的祖尔配置。
---
zuul:
routes:
legacySystem:
path: /legacySystem/**
url: https://test-server.domain.com/legacySystem/
server:
port: 8080
ribbon:
eureka:
enabled: false有人能帮我正确配置zuul服务器吗?关键是我不能更改遗留系统的配置和身份验证子系统。我想透明地将所有请求路由到遗留系统,稍后我将定义一些用于访问微服务的路由。遗留系统通过简单的DAO身份验证提供程序使用spring安全性。在这个步骤中,在zuul和遗留系统之间不需要任何会话或oAuth令牌。提前谢谢。
发布于 2020-12-30 20:41:11
我也是一样的人。我通过将这个类添加到Spring项目文档参考中解决了这个问题:zuul.html#zuul-redirect-location-rewrite
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.cloud.netflix.zuul.filters.post.LocationRewriteFilter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
@EnableZuulProxy
public class ZuulConfig {
@Bean
public LocationRewriteFilter locationRewriteFilter() {
return new LocationRewriteFilter();
}
}发布于 2017-10-20 12:29:29
我必须在我的sensitiveHeaders文件中放置空的application.yml标记。
https://stackoverflow.com/questions/46558432
复制相似问题