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"
- Trying xxx.xxx.xxx.xxx...
- TCP_NODELAY set
- Connected to www.mydomain.com (xxx.xxx.xxx.xxx) port 443 (#0)
- ALPN, offering h2
- ALPN, offering http/1.1
- successfully set certificate verify locations:
- CAfile: /etc/ssl/cert.pem
CApath: none
- TLSv1.2 (OUT), TLS handshake, Client hello (1):
- TLSv1.2 (IN), TLS handshake, Server hello (2):
- TLSv1.2 (IN), TLS handshake, Certificate (11):
- TLSv1.2 (IN), TLS handshake, Server key exchange (12):
- TLSv1.2 (IN), TLS handshake, Server finished (14):
- TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
- TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
- TLSv1.2 (OUT), TLS handshake, Finished (20):
- TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):
- TLSv1.2 (IN), TLS handshake, Finished (20):
- SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
- ALPN, server accepted to use h2
- Server certificate:
- subject: CN=mydomain.com
- start date: Mar 15 09:21:16 2021 GMT
- expire date: Jun 13 09:21:16 2021 GMT
- subjectAltName: host "www.mydomain.com" matched cert's "www.mydomain.com"
- issuer: C=US; O=Let's Encrypt; CN=R3
- SSL certificate verify ok.
- Using HTTP2, server supports multi-use
- Connection state changed (HTTP/2 confirmed)
- Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
- Using Stream ID: 1 (easy handle 0x7fe85d00d600)
HEAD /media/catalog/product/0/1/018084910993.jpg?width=320&height=320&store=it&image-type=small_image HTTP/2
Host: www.mydomain.com
User-Agent: curl/7.64.1
Accept: /
- Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
< HTTP/2 200
HTTP/2 200
< server: nginx
server: nginx
< date: Thu, 01 Apr 2021 07:39:54 GMT
date: Thu, 01 Apr 2021 07:39:54 GMT
< content-type: image/jpeg
content-type: image/jpeg
< content-length: 25929
content-length: 25929
< last-modified: Wed, 17 Mar 2021 16:07:28 GMT
last-modified: Wed, 17 Mar 2021 16:07:28 GMT
< etag: "60522940-6549"
etag: "60522940-6549"
< expires: Thu, 31 Dec 2037 23:55:55 GMT
expires: Thu, 31 Dec 2037 23:55:55 GMT
< cache-control: max-age=315360000, public
cache-control: max-age=315360000, public
< accept-ranges: bytes
accept-ranges: bytes
<
- Connection #0 to host www.mydomain.com left intact
- Closing connection 0
`
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