The site code says that the image is in the / images / folder (for example, <a href="/images/img.png"></a> )

the address of the image on the site looks like http://site.com/images/img.png using nginx to make the image link to the site at http://img.site.com/img.com or http: // img .site.com / images / img.com (the main thing is that the images are on a level 3 domain)

  • Write in the code page full path to the pictures. - Alexey Ten
  • Unfortunately this is not possible. it is necessary to implement nginx by means of - Jeison Mortyre
  • one
    Well then no way. Nginx can not change your page - Alexey Ten

1 answer 1

found a solution

 location ~* \.png$ { rewrite ^(.*)$ https://img.site.com$1 last; } 
  • And what did it do? - Alexey Ten