# Multiple remote mirror urls

**URL:** <https://community.sonatype.com/t/multiple-remote-mirror-urls/7622>\
**Category:** Sonatype Nexus Repository\
**Created:** [November 9, 2021, 10:23am UTC](https://community.sonatype.com/t/multiple-remote-mirror-urls/7622 "2021-11-09T10:23:38Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![saldrick](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@saldrick](https://community.sonatype.com/u/saldrick)\
**Post date:** [November 9, 2021, 10:23am UTC](https://community.sonatype.com/t/multiple-remote-mirror-urls/7622/1 "2021-11-09T10:23:38Z")

</div>

I am evaluating nexus to see whether it would work for us. So far so good, but I have one question…

Can I create a proxy repository with multiple upstream URLs so that nexus could obtain artifacts from any of them (i.e. the upstream URLs are mirrors) ?

I have some Arch Linux servers. I have been able to proxy the Arch package repositories as raw (I haven’t seen a plugin for Arch specifically). It works, it’s just we normally put a few mirrors in our package manager config and would like to do that in nexus but the remote field seems to want only a single url.

---

<div class="post-metadata">

**Author:** ![dsawa](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/dsawa/32/729_2.png) [@dsawa](https://community.sonatype.com/u/dsawa)\
**Post date:** [November 9, 2021, 11:15am UTC](https://community.sonatype.com/t/multiple-remote-mirror-urls/7622/2 "2021-11-09T11:15:26Z")

</div>

Hi Simon,

No, it’s not possible to specify multiple upstream URLs in a single proxy repository. However, what you are looking for is a group repository. You can create multiple proxy repositories, each pointing to one upstream URL, and then combine them all together in a single group repository. In such configuration, Nexus Repository will go through each member repository until one of them returns a positive response and serve it the client. One issue with that might be repository metadata if there is any, I’m sorry I’m not familiar with Arch repository format, but if there is any kind of repository index-like metadata file then the approach I described will fail, and the only solution would be to write a format plugin for Arch repository.

---

<div class="post-metadata">

**Author:** ![saldrick](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@saldrick](https://community.sonatype.com/u/saldrick)\
**Post date:** [November 9, 2021, 11:22am UTC](https://community.sonatype.com/t/multiple-remote-mirror-urls/7622/3 "2021-11-09T11:22:22Z")

</div>

Thank you for the quick reply David.

I looked at repository groups but I got the impression that it’s for grouping different proxied repositories that each offer different artifacts rather than providing multiple remote locations that offer the same artifacts.

In the specific case of arch, there is an index metadata file, so I don’t think groups will fit. I may take a look at what’s involved in writing a simple plugin to do this, if it’s possible that way.

---

<div class="post-metadata">

**Author:** ![dsawa](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/dsawa/32/729_2.png) [@dsawa](https://community.sonatype.com/u/dsawa)\
**Post date:** [November 9, 2021, 11:30am UTC](https://community.sonatype.com/t/multiple-remote-mirror-urls/7622/4 "2021-11-09T11:30:14Z")

</div>

> [@saldrick](#):
>
> I got the impression that it’s for grouping different proxied repositories that each offer different artifacts rather than providing multiple remote locations that offer the same artifacts

Yes, you’re right. It will not do any kind of load-balancing between the members. All requests will go after in the exact order as specified by ordering member repositories in proxy. However, if one of the members will stop responding or will be responding with errors it may be auto-blocked so your requests will be going to the next repository on the list.

Here’s an introduction on how to develop plugins for Nexus Repository: [Bundle Development](https://help.sonatype.com/repomanager3/bundle-development)

---

<div class="post-metadata">

**Author:** ![saldrick](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@saldrick](https://community.sonatype.com/u/saldrick)\
**Post date:** [November 9, 2021, 11:39am UTC](https://community.sonatype.com/t/multiple-remote-mirror-urls/7622/5 "2021-11-09T11:39:15Z")

</div>

Thanks. Do you think supporting multiple remotes would be considered as an enhancement?

Basically try given URLs in order to obtain the artifact from the first one that responds successfully. It doesn’t need to remember which remote it got the artifact from and load balancing would be a nice to-have but wasn’t what I was immediately after.

Thanks for the plugin dev link, I will take a look at that.

---

<div class="post-metadata">

**Author:** ![mmartz](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@mmartz](https://community.sonatype.com/u/mmartz)\
**Post date:** [November 9, 2021, 2:26pm UTC](https://community.sonatype.com/t/multiple-remote-mirror-urls/7622/6 "2021-11-09T14:26:30Z")

</div>

I mean, that’s what group repositories do. They try each member in order and respond with the first successful artifact.

---

<div class="post-metadata">

**Author:** ![mprescott](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/mprescott/32/178_2.png) [@mprescott](https://community.sonatype.com/u/mprescott)\
**Post date:** [November 9, 2021, 2:30pm UTC](https://community.sonatype.com/t/multiple-remote-mirror-urls/7622/7 "2021-11-09T14:30:58Z")

</div>

> [@saldrick](#):
>
> In the specific case of arch, there is an index metadata file, so I don’t think groups will fit.

@saldrick, can you explain your concern about the index file?

---

<div class="post-metadata">

**Author:** ![saldrick](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@saldrick](https://community.sonatype.com/u/saldrick)\
**Post date:** [November 9, 2021, 2:35pm UTC](https://community.sonatype.com/t/multiple-remote-mirror-urls/7622/8 "2021-11-09T14:35:33Z")

</div>

Hello, I was really following on the earlier comment about index files being a problem. I’ve since taken a look at the index file that Arch uses and it doesn’t refer to remote endpoints so it may not be a problem - I’d have to try it out. Each mirror would return the same index so as long as Nexus cached it from one mirror it should be fine.

If the recommendation is to try groups out then I’ll give it a go…

---

<div class="post-metadata">

**Author:** ![mprescott](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/mprescott/32/178_2.png) [@mprescott](https://community.sonatype.com/u/mprescott)\
**Post date:** [November 12, 2021, 7:21pm UTC](https://community.sonatype.com/t/multiple-remote-mirror-urls/7622/9 "2021-11-12T19:21:46Z")

</div>

Oh right, I missed that. The deal with index files is that a raw repository will just treat them as any other file. First-class support for a given format will mean that group repositories can _merge_ multiple index files from separate remote repositories, so that they hold the union of what’s in all the remotes.

In your use case, that won’t matter, since you expect each remote repository to have the same content, and therefore the same index. That means that the index file can be served as an opaque file by Repository, and it will still all work.
