On 07.07.2016 11:57, Amit Pande wrote:
Hello all,


In my server.xml, within in single Service element,

I have two HTTP connectors defined listening on two different ports (12345
& 54321 for example).

It is possible to apply the remote address/host filter so that request to
one of the ports (12345) are allowed only via localhost ? And requests to
other port (54321) are allowed from everywhere.


You do not indicate your Tomcat version, but what about :
http://tomcat.apache.org/tomcat-8.0-doc/config/http.html#Common_Attributes
-> Standard Implementation -> address
?

If you set one Connector to listen only on 127.0.0.1 (localhost), then only requests originating from the same localhost will be able to reach it, since that address means nothing for other hosts. On the other hand, set the other Connector to listen to the public IP of the host, which should be accessible from anywhere. (Or just don't set it, and it will be accessible also from localhost).

It is not the same as "allowing" accesses from various client IP's. But it achieves the same effect, in your case as you describe it above.



Or do I need to configure multiple service elements for this type of
requirement ?


Note that access to the Connector, or the port, does not correlate to access to the Hosts, or the applications.
If /that/ is really your requirement, then you need something else.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to