Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot Spring boot REST服务仅允许通过F5负载平衡器进行访问_Spring Boot_Tomcat_Load Balancing - Fatal编程技术网

Spring boot Spring boot REST服务仅允许通过F5负载平衡器进行访问

Spring boot Spring boot REST服务仅允许通过F5负载平衡器进行访问,spring-boot,tomcat,load-balancing,Spring Boot,Tomcat,Load Balancing,我在2台ApacheTomcat服务器(2个实例)上运行Spring引导REST服务。此外,我还配置了一个F5负载平衡器,用于在两个tomcat服务器实例之间转发请求 实际值: https://f5-host/api/example --> working HTTP: 200 https://tomcat-host1/api/example --> working HTTP: 200 https://tomcat-host2/api/example --> working HT

我在2台ApacheTomcat服务器(2个实例)上运行Spring引导REST服务。此外,我还配置了一个F5负载平衡器,用于在两个tomcat服务器实例之间转发请求

实际值:

https://f5-host/api/example --> working HTTP: 200
https://tomcat-host1/api/example --> working HTTP: 200
https://tomcat-host2/api/example --> working HTTP: 200
https://f5-host/api/example --> working HTTP: 200
https://tomcat-host1/api/example --> Access Denied HTTP: 403
https://tomcat-host2/api/example --> Access Denied HTTP: 403
问题是,我建议在通过tomcat服务器直接访问服务时,执行代码更改以限制访问。我认为这可以通过ApacheTomcat服务器中的配置直接实现。有人能在这里建议最好的方法/配置细节吗

期望值:

https://f5-host/api/example --> working HTTP: 200
https://tomcat-host1/api/example --> working HTTP: 200
https://tomcat-host2/api/example --> working HTTP: 200
https://f5-host/api/example --> working HTTP: 200
https://tomcat-host1/api/example --> Access Denied HTTP: 403
https://tomcat-host2/api/example --> Access Denied HTTP: 403

哪个Spring Boot版本?Spring Boot 2.1.8版本