I have Solr 6.6 running via Jetty.
I have successfully enabled basic authentication by modifying the etc/jetty.xml
and etc/webdefault.xml
. This question
I could also restrict access to Solr based on IP address by adding IPAccessHandler
around the ContextHandlerCollection
. This question
But what I want to achieve is to have authentication needed for requests coming from all external IPs except requests coming from localhost(127.0.0.1) . Localhost should be able to access Solr REST APIs without any authentication needed.
I think that I need to setup jetty to run 2 servers or 2 virtual hosts but I can't figure it out how exactly. Obviously the 2 servers (or virtual hosts) should be connected to the same Solr instance. P.S.: It's acceptable if the requests from Localhost that need to be served without authentication, should be sent on a different port.