Nexus uses the Jetty container and Jetty provides a handler that can be used to restrict access by IP addresses and subnets.
Attached is a sample jetty config file that allows you to configure the IP Access Handler using Nexus 2.8+.
To configure it:
- Download and store the file at
NEXUS_HOME/conf/jetty-ipaccess.xml, with the same permissions as the other jetty files
NEXUS_HOME/conf/jetty-ipaccess.xml, add white listed and blacklisted addresses using the syntax as documented in the javadoc. By default, all access is allowed
NEXUS_HOME/bin/jsw/conf/wrapper.conf, and reference the new jetty file as an app parameter ie
wrapper.app.parameter.3=./conf/jetty-ipaccess.xml( 3 by default, however the next available number must be used )
- restart Nexus