Reputation: 1666
I've tried to adjust Spring Security with hasIpAddress filter and faced a strange problem.
There are two WARs on my Tomcat server. App 'A' requests App 'B' and then app 'B' requests App 'A'.
I'm logging RemoteAddr from HttpServletRequest object in each controller.
On local VM, everything works fine:
2016-03-29 18:38:08,186 APP 'A' ADDRESS: 127.0.0.1
2016-03-29 18:38:08,367 APP 'B' ADDRESS: 127.0.0.1
But on our stage server, things become different:
2016-03-29 18:45:09,292 APP 'A' ADDRESS: 127.0.0.1
2016-03-29 18:45:09,456 APP 'B' ADDRESS: 192.168.24.201
How come two WARs on the same Tomcat can have different remote address? What should I check to fix this?
Thank you.
Upvotes: 3
Views: 66
Reputation: 1666
I've just figured out, that my request ip to APP B in stage environment differs from request ip to APP B. That was a bug in properties.
That means, when you request 127.0.0.1, you have an answer from 127.0.0.1. When you request server public ip, you have request from public ip.
Problem solved. Thank you.
Upvotes: 1