Skip to content

Fast and secure standalone server for resizing and converting images

Notifications You must be signed in to change notification settings

websecret/imgproxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Imgproxy

https://websecret.by/blog/optimizaciya-izobrazhenij-na-krupnyh-proektah

Install

  • yarn

  • cp config-example.js config.js и указываем путь к конфигу картинок

  • mkdir projects && cd mkdir && ln -s ~/site.by/images.js site.js - создаем symbol ссылку к конфигам

    small: {
        width: 211,
        height: 130,
        quality: 100,
    }
  • Настраиваем nginx и запускаем pm2
server {
    listen 80;
    server_name imgproxy.localhost;
    
    location / {
        proxy_cache imgproxy;
        proxy_cache_valid 200 30d;
        expires 30d;
        proxy_pass http://127.0.0.1:1337;
    }
}
  • Стартуем pm2 cd ../ && pm2 start npm --name "imgproxy" -- start

About

Fast and secure standalone server for resizing and converting images

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published