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

  1. storage:
  2. azure:
  3. accountname: "ACCOUNT_NAME"
  4. accountkey: "******"
  5. container: container-name
  6. middleware:
  7. storage:
  8. - name: rewrite
  9. options:
  10. scheme: https
  11. host: example-cdn-endpoint.azurefd.net
  12. trimpathprefix: /container-name