How to add a load balancing front end to Nexus Repository 2 Pro

Visit my.sonatype.com for documentation on Nexus Repository version 2.

A single Nexus Repository 2 instance scales extremely well, and you will likely find it unnecessary to improve its throughput.

But if you decide that you do need extra scalability, it is quite easy to use the Smart Proxy technology in Nexus Repository 2.x Pro to add a load balancing front end to your Nexus server. Smart Proxy helps keep the not-found-cache in sync between the proxies and the master repository, to avoid spurious not found responses and avoid setting the cache timeout values on the proxies too low, impacting performance.

Create two additional Nexus Repository 2 Pro instances that contain Smart Proxy repositories (release and snapshot) which point back to the main instance's group repository.  Load balance GET/HEAD requests to ${base_url}/content to the two front end servers, and send other requests (such as PUT and POST) to the master. 

Don't load balance requests to REST resources, such as ${base_url}/service or ${base_url}/siesta - you'll need these requests to go directly to all three instances so you can administer them using the web UI.

See the attached "default.conf" for an example of how you might set this up using Nginx.

Have more questions? Submit a request

2 Comments

  • 0
    Avatar
    Edward Webb (suspended)

    Just a note to fellow admins.  Make sure your load balancer does not alter the HOST header, but lets Nexus consume what it set by the client.  This enabled you to leave the setting under  Administration > Server > Application Server Settings > Base URL > Force URL to remain unchecked, and trust the headers set by the client. This means you can safely access top level URLs and legged URLs directly without getting Cross-Domain-Origin .

  • 0
    Avatar
    Peter Lynch

    We are closing this article for comments.

    If you have a support license, please contact us by submitting a support ticket.

    If you do not have a support license, please use our Nexus Users List or our other free support resources.

Article is closed for comments.