# Install all of the things apt-get update apt-get install nginx /etc/init.d/nginx start apt-get install python-dev apt-get install python-pip apt-get install libjpeg-dev libpng-dev libtiff-dev libjasper-dev libgtk2.0-dev python-numpy python-pycurl libwebp-dev python-opencv ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib pip install pillow pip install thumbor==4.12.2 easy_install supervisor mkdir logs # /etc/thumbor.conf import os DETECTORS = [ 'thumbor.detectors.face_detector', ] FILTERS = [ 'thumbor.filters.quality', ] ALLOW_UNSAFE_URL = False AUTO_WEBP = True MAX_AGE = 60 * 60 * 24 * 365 QUALITY = 100 SECURITY_KEY = 'whatever' import os DETECTORS = [ 'thumbor.detectors.face_detector', ] FILTERS = [ 'thumbor.filters.quality', ] ALLOW_UNSAFE_URL = False AUTO_WEBP = True MAX_AGE = 60 * 60 * 24 * 365 QUALITY = 100 SECURITY_KEY = '7Pq0p3SrtiuQP6raNQkHlNogfP2j10112' STORAGE = 'thumbor.storages.file_storage' STORAGE_EXPIRATION_SECONDS = 60 * 60 * 24 * 30 # /etc/supervisord.conf [supervisord] [program:thumbor] command=thumbor --conf="/etc/thumbor.conf" --port=800%(process_num)s process_name=thumbor800%(process_num)s numprocs=4 autostart=true autorestart=true startretries=3 stopsignal=TERM stdout_logfile=/home/ubuntu/logs/thumbor800%(process_num)s.stdout.log stdout_logfile_maxbytes=1MB stdout_logfile_backups=10 stderr_logfile=/home/ubuntu/logs/thumbor800%(process_num)s.stderr.log stderr_logfile_maxbytes=1MB stderr_logfile_backups=10 $ supervisord -c /etc/supervisord.conf # /etc/nginx/nginx.conf upstream thumbor { server 127.0.0.1:8000; server 127.0.0.1:8001; server 127.0.0.1:8002; server 127.0.0.1:8003; } server { listen 80; server_name localhost; location / { proxy_pass http://thumbor; } } $ service nginx start