img-proxy
The image proxy feature allows redirecting image requests to a remote domain (typically production) through an Apache reverse proxy. This is useful for development environments where you want to use production images without downloading them locally.
How it worksβ
When enabled, Apache intercepts image requests matching specific patterns and proxies them to the configured remote domain. The following image types are proxied:
- Direct image URLs:
/img/*(jpg, jpeg, png, gif, webp, avif) - SEO product URLs: PrestaShop friendly URLs for products (1 to 7 digits)
- SEO category URLs: Category images with various URL patterns
- Fancybox images:
/images_ie/*images
Local files take precedence: if an image exists locally, it is served directly without proxying.
Commandsβ
Statusβ
Display current image proxy configuration:
dvs img-proxy status
Shows:
- Current domain (if set)
- Image proxy mode (enabled/disabled)
Set domainβ
Configure the remote domain to proxy images from:
dvs img-proxy set-domain <domain>
Example:
dvs img-proxy set-domain shop.example.com
If the proxy is already enabled, Apache will reload automatically after setting the domain.
Enableβ
Enable image proxy mode. Requires a domain to be set first:
dvs img-proxy enable
If no domain is configured, you'll be prompted to set one using set-domain.
Disableβ
Disable image proxy mode:
dvs img-proxy disable
Toggleβ
Toggle image proxy mode on/off:
dvs img-proxy toggle
If enabling and no domain is set, you'll be prompted to configure one first.
Usage exampleβ
# Check current status
dvs img-proxy status
# Configure remote domain
dvs img-proxy set-domain production.example.com
# Enable proxy
dvs img-proxy enable
# Later, disable it
dvs img-proxy disable
Technical detailsβ
- Apache is reloaded automatically when enabling/disabling or changing the domain
- The proxy uses SSL/TLS to connect to the remote domain
- Only image requests are proxied; local files (CSS, JS, theme images) are served normally