Why is Tomcat refusing a connection from my other server?
I have server A making a request to server B. I've tried both php's file_get_contents and curl; both refuse the connection. I'm trying to connect to a tomcat application on server B.
The connection does work if I make a request to google.com, or to another application on server B that is not in the Tomcat application.
This leads me to believe there's something specific to my tomcat in开发者_如何学Cstallation that is rejecting the request from server A. Thoughts? Any more info I can provide to help with the problem?
Is there a way to whitelist my server A in tomcat so the connection is accepted? Or as a last resort how would I accept all requests?
Edit: I also wanted to add that the connection to server B works just fine when I'm connecting from my local development machine.
Your test from server A to google.com or other apps on server B probably use port 80. Many firewalls don't allow traffic on strange ports like 8089.
If you can't change the firewall rule to allow access to serverB:8089, I think the right way to do it is to proxy the request through the server B web server. So server A would request "serverB:80/yourproxyurl" and the web server on server B would talk to the tomcat server on localhost, and output the response.
This is what Tomcat Connectors are for, as I understand it.
精彩评论