Skip to main content

HTTP and HTTPS Request and Proxy Settings

Sonatype Nexus Repository uses HTTP requests to fetch content from remote servers. In some cases, you may wish to customize these request settings. For example, many organizations use proxy servers for outbound HTTP network traffic. Users with the nx-settings privilege can configure HTTP and HTTPS request and proxy settings under Administration (cog icon)SystemHTTP in the Nexus Repository user interface.

Partial view of HTTP configuration screen

Available HTTP and HTTPS Settings

The following configurations are available under Administration (cog icon)SystemHTTP in the Nexus Repository user interface:

The HTTP configuration in User-agent customization allows you to append a string to the User-Agent HTTP header field. This can be a required customization by your proxy servers.

The Connection/Socket Timeout configuration controls the amount of time (in seconds) that Nexus Repository waits for a request to succeed when interacting with an external remote repository. This defaults to 30 seconds.

The Connection/Socket Retry Attempts configuration controls the number of retry attempts Nexus Repository makes when requests fail. This defaults to 2.

If your Nexus Repository instance needs to reach public repositories like the Central Repository via a proxy server, you can configure those HTTP and/or HTTPS connections in the Proxy Settings section. This is a critical initial step for many Sonatype Nexus Repository deployments as most environments are typically secured via an HTTP/HTTPS proxy server for all outgoing internet traffic.

HTTP Authentication and HTTPS Authentication sections of HTTP Configuration form

In the Proxy Settings section, select the Enable HTTP proxy checkbox to configure an HTTP proxy.

Nexus Repository 3 HTTP Proxy Settings

Specify an IP address or DNS name in the HTTP Proxy Host field; this should not be a URL.

Provide your HTTP proxy server's port number in the HTTP Proxy Port field.

HTTP Authentication

If your HTTP proxy server requires authentication, select the Enable HTTP Authentication checkbox to provide authentication details. Then, enter either a username and password or Windows NTLM hostname and domain (if using a Windows NT LAN Manager).

In the Proxy Settings section, select the Enable HTTPS proxy checkbox to configure an HTTPS proxy.

HTTPS-Auth-Config.png

Specify an IP address or DNS name in the HTTPS Proxy Host field; this should not be a URL.

Provide your HTTPS proxy server's port number in the HTTP Proxy Port field.

HTTPS Authentication

If your HTTPS proxy server requires authentication, select the Enable HTTPS Authentication checkbox to provide authentication details. Then, enter either a username and password or Windows NTLM hostname and domain (if using a Windows NT LAN Manager).

In the Hosts to exclude from HTTP/HTTPS Proxy field, you can configure hosts that you would like Nexus Repository to reach directly, ignoring the proxy settings. Requests to these hosts will not go through the configured HTTP/HTTPS proxy.

In the Hosts to exclude from HTTP/HTTPS Proxy field, provide a host name; then, select the plus sign (+) button to add the host.

You can use the * character as a wildcard to match numerous host names (e.g., *.example.com).

You can also remove any hosts from the list using the x button.

Default HTTP Settings in Nexus Repository 3

The default HTTP settings in Nexus Repository 3 are as follows:

Setting

Default Value

Description

Connection/Socket Retry Attempts

2

The number of times Nexus Repository will automatically retry a request to a remote server if the initial request fails.

Connection/Socket Timeout

30 seconds

The maximum amount of time that Nexus Repository will wait while trying to establish an initial connection to a remote server.

Request Timeout

20 seconds

After Nexus Repository has already established an initial connection with a remote server, the Request Timeout configuration controls the amount of time Nexus Repository will wait for a response to a specific request.

Keep Alive Duration

30 seconds

How long to keep connections open for reuse.

Buffer Size

8k bytes

The maximum number of bytes that can be buffered when reading or writing response or request content.