Skip to content

Update image rewrite rules for Nginx configuration#2151

Merged
kpodemski merged 2 commits into
PrestaShop:9.xfrom
gusdleon:patch-1
Jun 8, 2026
Merged

Update image rewrite rules for Nginx configuration#2151
kpodemski merged 2 commits into
PrestaShop:9.xfrom
gusdleon:patch-1

Conversation

@gusdleon
Copy link
Copy Markdown
Contributor

@gusdleon gusdleon commented Jun 7, 2026

Questions Answers
Branch? 9.x
Description? Enabling webp images on Design>Image Settings breaks all product/category images resulting in 404 errors, this solves the issue
Fixed ticket? N/A
Sponsor company N/A

Enabling webp images on Design>Image Settings breaks all images resulting in 404 errors, this solves the issue
Copilot AI review requested due to automatic review settings June 7, 2026 09:44
@github-actions github-actions Bot added the 9.x label Jun 7, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the Nginx rewrite examples to support additional image formats beyond JPG (e.g., PNG/WebP/AVIF) for PrestaShop-style image URLs.

Changes:

  • Expanded product image rewrite rules to match jpeg/jpg/png/webp/avif.
  • Updated category image rewrites to preserve the original extension.
  • Extended the images_ie FancyBox rewrite rule to allow additional extensions.

Comment thread basics/installation/advanced/nginx.md Outdated
rewrite ^/(\d)(\d)(\d)(\d)(\d)(-[\w-]+)?/.+\.(jpe?g|png|webp|avif)$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6.$7 last;
rewrite ^/(\d)(\d)(\d)(\d)(\d)(\d)(-[\w-]+)?/.+\.(jpe?g|png|webp|avif)$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.$8 last;
rewrite ^/(\d)(\d)(\d)(\d)(\d)(\d)(\d)(-[\w-]+)?/.+\.(jpe?g|png|webp|avif)$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8.$9 last;
rewrite ^/(\d)(\d)(\d)(\d)(\d)(\d)(\d)(\d)(-[\w-]+)?/.+\.(?<10>jpe?g|png|webp|avif)$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.$10 last;
fixing what copilot says its wrong (im my install works just well)
@kpodemski kpodemski merged commit 2b8e8b3 into PrestaShop:9.x Jun 8, 2026
2 checks passed
@kpodemski
Copy link
Copy Markdown
Contributor

thank you @gusdleon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants