How to Allow Cookie Usage For Remote Requests

By default, Nexus remote storage requests ignore all Set-Cookie response headers from proxied repositories.

Nexus 2.11.2 and greater allows some configurability about how cookies are used for remote storage requests.

How To Allow HTTP Cookie Usage Per Remote Storage Host

Nexus 2.11.2 and greater can be configured to allow maintaining cookies of outbound remote storage requests on a host name basis.

  1. Determine what host names you need to allow cookies for. The host names should case insensitively match the host names configured as part of the remote URL value used in a Proxy Repository.
  2. Edit ${NEXUS_INSTALL_DIR}/conf/nexus.properties. Add a property on a new line with a comma separated list of remote host names:
    # Comma separated list of hostnames that might benefit from cookies
    nexus.remoteStorage.useCookiesForHosts=example.com,subdomain.example.com
  3. Start or restart Nexus for the list of host names to take effect.

    Nexus will begin to keep an in memory cache of cookie values received from the remote hosts and resend these cookies when appropriate for remote storage requests.

Have more questions? Submit a request

0 Comments

Article is closed for comments.