mirror of
https://github.com/distribution/distribution.git
synced 2025-09-15 06:39:25 +00:00
feat: implement 'rewrite' storage middleware (#4146)
This commit is contained in:
15
docs/content/storage-drivers/middleware/_index.md
Normal file
15
docs/content/storage-drivers/middleware/_index.md
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
description: Explains how to use storage middleware
|
||||
keywords: registry, on-prem, images, tags, repository, distribution, storage drivers, advanced
|
||||
title: Storage middleware
|
||||
---
|
||||
|
||||
This document describes the registry storage middleware.
|
||||
|
||||
## Provided middleware
|
||||
|
||||
This storage driver package comes bundled with several middleware options:
|
||||
|
||||
- cloudfront
|
||||
- redirect
|
||||
- [rewrite](rewrite): Partially rewrites the URL returned by the storage driver.
|
32
docs/content/storage-drivers/middleware/rewrite.md
Normal file
32
docs/content/storage-drivers/middleware/rewrite.md
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
description: Explains how to use the rewrite storage middleware
|
||||
keywords: registry, service, driver, images, storage, middleware, rewrite
|
||||
title: Rewrite middleware
|
||||
---
|
||||
|
||||
A storage middleware which allows to rewrite the URL returned by the storage driver.
|
||||
|
||||
For example, it can be used to rewrite the Blob Storage URL returned by the Azure Blob Storage driver to use Azure CDN.
|
||||
|
||||
## Parameters
|
||||
|
||||
* `scheme`: (optional): Rewrite the returned URL scheme (if set).
|
||||
* `host`: (optional): Rewrite the returned URL host (if set).
|
||||
* `trimpathprefix` (optional): Trim the prefix from the returned URL path (if set).
|
||||
|
||||
## Example configuration
|
||||
|
||||
```yaml
|
||||
storage:
|
||||
azure:
|
||||
accountname: "ACCOUNT_NAME"
|
||||
accountkey: "******"
|
||||
container: container-name
|
||||
middleware:
|
||||
storage:
|
||||
- name: rewrite
|
||||
options:
|
||||
scheme: https
|
||||
host: example-cdn-endpoint.azurefd.net
|
||||
trimpathprefix: /container-name
|
||||
```
|
Reference in New Issue
Block a user