Magento2 Custom Image URLS for the catalog

Installs: 2 824

Dependents: 0

Suggesters: 0

Security: 0

Stars: 18

Watchers: 4

Forks: 3

Open Issues: 1


dev-master / 1.0.x-dev 2021-12-07 08:25 UTC

This package is auto-updated.

Last update: 2023-06-07 11:54:00 UTC


Magento 2.4 has the option to set a dynamic URL (General -> Web -> Url options). This module adds an extra option to define the format of the URL.


composer require fruitcake/magento2-custom-image-url
php bin/magento module:enable Fruitcake_CustomImageUrl
php bin/magento setup:upgrade


You can configure the url in General -> Web -> Url Options. Set the 'Catalog media URL format' option to 'Image optimization based on query parameters'. This will prevent Magento from creating resized images. Select a Custom URL format for Imgproxy or Pattern, to use this module.



Provide a pattern to replace the URL with:


The available filters (for urlencode etc) and variables are described in the config.



Use the Imgproxy format, either with URL, S3 or Local files. You can provide a key/hash to sign the URLs

This can be used with the AWS Remote storage:

You can provide the host and options. The format will be generated by the module.

Inscecure proxy to map the URL + Convert to Webp:

docker run -p 8080:8080 -e IMGPROXY_ENFORCE_WEBP=1 darthsim/imgproxy

Example Docker config to proxy with S3 + Signature

docker run -p 8080:8080 -e IMGPROXY_USE_S3=1 -e AWS_ACCESS_KEY_ID=accesskey -e IMGPROXY_S3_REGION=eu-central-1 -e AWS_SECRET_ACCESS_KEY="secret" -e IMGPROXY_KEY=key -e IMGPROXY_SALT=salt darthsim/imgproxy

See for more options.

See imgproxy-nginx-cached.conf for an example nginx proxy config with caching enabled.

Todo / future ideas

  • Other CDNs
  • ..