Outbound IPv6
As of Nexus Repo 3.71.0 support for IPv6 is enabled by default in Nexus Repo.
Earlier versions shipped with IPv6 support disabled.
To enable IPv6 in an older version of Nexus Repo edit the $installdir/bin/nexus.vmoptions file and remove this line:
-Djava.net.preferIPv4Stack=true
For docker a simple custom Dockerfile can accomplish the same thing:
ARG NEXUS3_TAG_VERSION=latest
FROM sonatype/nexus3:${NEXUS3_TAG_VERSION}
USER root
RUN sed -ri 's/(-Djava.net.preferIPv4Stack=).*/\1false/g' /opt/sonatype/nexus/bin/nexus. vmoptions
USER nexus
You may also need to add this to the java arguments:
-Djava.net.preferIPv6Addresses=true
The default behavior of java is to use IPv4 if both IPv4 and IPv6 addresses are available for a host.
https://docs.oracle.com/javase%2F7%2Fdocs%2Fapi%2F/java/net/doc-files/net-properties.html
Inbound IPv6
In addition to the above steps, edit $workdir/etc/nexus.properties and add this line:
application-host=::
That will tell the embedded jetty web server to bind to IPv6 addresses.
If you are running in a container, add this to the INSTALL4J_ADD_VM_PARAMS environment variable
-Dapplication-host=::