magenx / Magento-nginx-config

Default Nginx config for Magento 2
https://www.magenx.com
GNU General Public License v3.0
506 stars 211 forks source link

Media directive problem #39

Closed ilevennet closed 3 years ago

ilevennet commented 3 years ago

Hi, seems that Magento don't rewrite and resize images both in admin area then frontend. After many searches it can be an nginx issue. Nginx configuration seems to be ok. I have enabled nginx debug, passed all varnish requests and disabled opcache and i have this result: ` % curl -Ivl "https://www.mydomain.com/media/catalog/product/0/1/018084910993.jpg?width=320&height=320&store=it&image-type=small_image"

<

In nginx logs I have: ` 2021/04/01 09:39:54 [notice] 1273459#1273459: 7 "^/static/(version\d/)?(.*)$" does not match "/media/catalog/product/0/1/018084910993.jpg", client: 151.77.185.247, server: www.mydomain.com, request: "HEAD /media/catalog/product/0/1/018084910993.jpg?width=320&height=320&store=it&image-type=small_image HTTP/1.1", host: "www.mydomain.com"

2021/04/01 09:39:54 [notice] 1273459#1273459: *7 "/(admin_6g9joz|PMA_PLACEHOLDER)/" does not match "/media/catalog/product/0/1/018084910993.jpg?width=320&height=320&store=it&image-type=small_image", client: 151.77.185.247, server: www.mydomain.com, request: "HEAD /media/catalog/product/0/1/018084910993.jpg?width=320&height=320&store=it&image-type=small_image HTTP/1.1", host: "www.mydomain.com"

2021/04/01 09:39:54 [notice] 1273459#1273459: 7 "^(./)index.php(/?)(.*)" does not match "/media/catalog/product/0/1/018084910993.jpg?width=320&height=320&store=it&image-type=small_image", client: 151.77.185.247, server: www.mydomain.com, request: "HEAD /media/catalog/product/0/1/018084910993.jpg?width=320&height=320&store=it&image-type=small_image HTTP/1.1", host: "www.mydomain.com"

2021/04/01 09:39:54 [notice] 1273459#1273459: *7 "^(brand|cat|color|dir|from|limit|price|type|mode|size|manufacturer|product_list_mode|product_list_order|product_list_dir)=.+" does not match "width=320&height=320&store=it&image-type=small_image", client: 151.77.185.247, server: www.mydomain.com, request: "HEAD /media/catalog/product/0/1/018084910993.jpg?width=320&height=320&store=it&image-type=small_image HTTP/1.1", host: "www.mydomain.com"

2021/04/01 09:39:54 [warn] 1273459#1273459: *7 using uninitialized "filters" variable, client: 151.77.185.247, server: www.mydomain.com, request: "HEAD /media/catalog/product/0/1/018084910993.jpg?width=320&height=320&store=it&image-type=small_image HTTP/1.1", host: "www.mydomain.com" `

and all images url generate full image with parameters

Schermata 2021-04-01 alle 09 59 33
magenx commented 3 years ago

please confirm is it magento module? not sure, where is the error exactly?

ilevennet commented 3 years ago

Sorry, my mistake