I want to use a method to limit the ip that hosts with Nexus Repository 3 installed

I want to use a method to limit the ip that hosts with Nexus Repository 3 installed described in the above document can access, how do I do it?
and Is it possible to implement the method suggestion in the document by the method in the document below?

Also, is there a way not to expose error messages on http response when an error occurs?