基于Minio和Thumbor搭建独立图片服务

基于https://github.com/rongfengliang/mino-thumbor-openresty改造,一开始使用这个大佬docker-compose无法正确运行,可能是时间久远。改后可以正常运行。填写备忘。 改造如下

openresty 里面nginx配置

worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    gzip  on;
    set_real_ip_from  172.17.0.0/24;
    real_ip_header     X-Forwarded-For;
    real_ip_recursive on;
    resolver  127.0.0.11 ipv6=off;
    server {
        listen       80;
        server_name  localhost;

        charset utf-8;
        #location  /mydemo/{
        #    root   html;
        #    proxy_set_header Host $http_host;
        #    proxy_set_header X-Forwarded-For $remote_addr;
        #    proxy_set_header X-real-ip $remote_addr;
        #    client_body_buffer_size 10M;
        #    client_max_body_size 10G;
        #    proxy_buffers 1024 4k;
        #    proxy_read_timeout 300;
        #    proxy_pass http://minio:9000/;
        #}
        location /{
            proxy_set_header Host $http_host;
            proxy_set_header X-Forwarded-For $remote_addr;
            client_body_buffer_size 10M;
            client_max_body_size 10G;
            proxy_buffers 1024 4k;
            proxy_read_timeout 300;
            proxy_pass http://thumbor:8000/unsafe/http://minio:9000$request_uri;
        }
        location /alert {
         default_type text/html;
         content_by_lua_block{
             ngx.say([[<script>alert("error")</script>]])
         }
        }
        location /ip {
            default_type text/html;
            content_by_lua_block{
                ngx.say(ngx.var.remote_addr)
            }
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
    server {
        listen       88;
        server_name  localhost;
        charset utf-8;
        location / {
            root   html;
            index  index.html index.htm;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

Dockerfile-nginx 文件

FROM openresty/openresty:1.15.8.2-7-bionic
LABEL name="www.datayang.com"
LABEL version="v1.0.0"
ENV name=datyang
ENV version=v1.0.0
COPY nginx.conf usr/local/openresty/nginx/conf/
EXPOSE 80
EXPOSE 443
EXPOSE 88

docker-compose.yml文件

version: '3'
services:
  nginx:
    image: mynginx-minio
    build:
      context: .
      dockerfile: Dockerfile-nginx
    ports:
      - 8087:80
    depends_on:
      - thumbor
      - minio
  thumbor:
    image: apsl/thumbor
    container_name: thumbor
  minio:
    image: minio/minio
    container_name: minio
    volumes:
      - ./data:/data
      - ./config:/root/.minio
    ports:
      - 9091:9000
    environment:
      MINIO_ACCESS_KEY: admin
      MINIO_SECRET_KEY: admin1233456788
    command: server /data

宿主机nginx 配置 mino.conf

server {
   listen 80;
   server_name  mymino.datayang.com;
   index index.html index.php index.htm;


   return      301 https://$server_name$request_uri;      #这是nginx最新支持的写法

}

server {
       listen       443 ssl http2;
       server_name  mymino.datayang.com;

       charset utf-8;
       #index index.html index.htm;
       ssl_certificate  ./ssl/fullchain.cer;
       ssl_certificate_key ./ssl/test.com.key;
       ssl_session_timeout 5m;
       #优先采取服务器算法
       ssl_prefer_server_ciphers on;
       ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
       ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;

       root         /usr/share/nginx/html;

       location /
       {
               proxy_set_header        Host $http_host;
               proxy_set_header        X-Real-IP $remote_addr;
               proxy_set_header        Upgrade $http_upgrade;
               proxy_set_header        Connection "upgrade";
               proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
               proxy_set_header        X-Forwarded-Proto $scheme;
               proxy_redirect off;
               client_body_buffer_size 10M;
               client_max_body_size 5G;
               proxy_pass http://127.0.0.1:9091;
       }

}

openresty.conf配置

server {
    listen 80;
    server_name  img.datayang.com;
    index index.html index.php index.htm;


    return      301 https://$server_name$request_uri;      #这是nginx最新支持的写法

 }

server {
        listen       443 ssl http2;
        server_name  img.datayang.com;

        charset utf-8;
        #index index.html index.htm;
        ssl_certificate    ./ssl/fullchain.cer;
        ssl_certificate_key ./ssl/test.com.key;
        ssl_session_timeout 5m;
        #优先采取服务器算法
        ssl_prefer_server_ciphers on;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;

        root         /usr/share/nginx/html;

        location /
        {
                proxy_set_header        Host $http_host;
                proxy_set_header        X-Real-IP $remote_addr;
                proxy_set_header        Upgrade $http_upgrade;
                proxy_set_header        Connection "upgrade";
                proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header        X-Forwarded-Proto $scheme;
                proxy_redirect off;

                client_body_buffer_size 10M;
                client_max_body_size 5G;

                proxy_pass http://127.0.0.1:8087;
        }

}

附加thumbor配置文件,如有需要可隐射处理修改配置

################################### 日志配置 ####################################

## Logging configuration as json
## Defaults to: None
THUMBOR_LOG_CONFIG = None

## Log Format to be used by thumbor when writing log messages.
## Defaults to: %(asctime)s %(name)s:%(levelname)s %(message)s
THUMBOR_LOG_FORMAT = '%(asctime)s %(name)s:%(levelname)s %(message)s'

## Date Format to be used by thumbor when writing log messages.
## Defaults to: %Y-%m-%d %H:%M:%S
THUMBOR_LOG_DATE_FORMAT = '%Y-%m-%d %H:%M:%S'

################################################################################


################################### Imaging ####################################

## 读取或者创建图片的最大宽度(PX),0为不限制
## Defaults to: 0
MAX_WIDTH = 1024

## 读取或者创建图片的最大高度(PX),0为不限制
## Defaults to: 0
MAX_HEIGHT = 0

## 读取的最大像素
## Defaults to: 75000000 pixels
MAX_PIXELS = 75000000

## 读取或者创建图片的最小宽度(PX)
## Defaults to: 1
MIN_WIDTH = 1

## 读取或者创建图片的最小高度(PX)
## Defaults to: 1
MIN_HEIGHT = 1

## 域名白名单,添加后别人不能引用
## expressions.
## Defaults to: []
ALLOWED_SOURCES =  []


## 生成JPEG的质量
## Defaults to: 80
QUALITY = 80

## 是否使用渐进式加载图片.
## Defaults to: True
PROGRESSIVE_JPEG = True

## Specify subsampling behavior for Pillow (see `subsampling`               in
## http://pillow.readthedocs.org/en/latest/handbook/image-file-
## formats.html#jpeg).Be careful to use int for 0,1,2 and string for "4:4:4"
## notation. Will ignore `quality`. Using `keep` will copy the original file's
## subsampling.
## Defaults to: None
PILLOW_JPEG_SUBSAMPLING = None

## Specify quantization tables for Pillow (see `qtables`               in
## http://pillow.readthedocs.org/en/latest/handbook/image-file-
## formats.html#jpeg). Will ignore `quality`. Using `keep` will copy the
## original file's qtables.
## Defaults to: None
PILLOW_JPEG_QTABLES = None

## Specify resampling filter for Pillow resize method.One of LANCZOS, NEAREST,
## BILINEAR, BICUBIC, HAMMING (Pillow>=3.4.0).
## Defaults to: 'LANCZOS'
PILLOW_RESAMPLING_FILTER = 'LANCZOS'

## Quality index used for generated WebP images. If not set (None) the same level
## of JPEG quality will be used.
## Defaults to: None
WEBP_QUALITY = None


## PNG 的压缩级别.
## Defaults to: 6
PNG_COMPRESSION_LEVEL = 6

## Specifies whether WebP format should be used automatically if the request
## accepts it (via Accept header)
## Defaults to: False
AUTO_WEBP = False

## Specify the ratio between 1in and 1px for SVG images. This is only used
## whenrasterizing SVG images having their size units in cm or inches.
## Defaults to: 150
SVG_DPI = 150

## Max AGE sent as a header for the image served by thumbor in seconds
## Defaults to: 86400
MAX_AGE = 86400

## Indicates the Max AGE header in seconds for temporary images (images with
## failed smart detection)
## Defaults to: 0
MAX_AGE_TEMP_IMAGE = 0

## Indicates whether thumbor should rotate images that have an Orientation EXIF
## header
## Defaults to: False
RESPECT_ORIENTATION = False

## 忽略错误并返回原图 (not
## saved in result storage and with MAX_AGE_TEMP_IMAGE age)
## Defaults to: False
IGNORE_SMART_ERRORS = False

## Sends If-Modified-Since & Last-Modified headers; requires support from result
## storage
## Defaults to: False
SEND_IF_MODIFIED_LAST_MODIFIED_HEADERS = False

## 保留 exif 信息(图片会变大).
## Defaults to: False
PRESERVE_EXIF_INFO = False

## 启用动画支持.
## Defaults to: True
ALLOW_ANIMATED_GIFS = False

## Indicates whether thumbor should use gifsicle engine. Please note that smart
## cropping and filters are not supported for gifs using gifsicle (but won't
## give an error).
## Defaults to: False
USE_GIFSICLE_ENGINE = False

## 启用黑名单.
## Defaults to: False
USE_BLACKLIST = False

## 图像转换的线程池大小.  The default value is
## 0 (don't use a threadpoool. Increase this if you are seeing your IOLoop
## getting blocked (often indicated by your upstream HTTP requests timing out)
## Defaults to: 0
ENGINE_THREADPOOL_SIZE = 0



################################################################################


################################ Extensibility #################################

## The metrics backend thumbor should use to measure internal actions. This must
## be the full name of a python module (python must be able to import it)
## Defaults to: 'thumbor.metrics.logger_metrics'
METRICS = 'thumbor.metrics.logger_metrics'

## 图片加载方式
## thumbor.loaders.http_loader 网络加载
## thumbor.loaders.file_loader 本地加载
## full name of a python module (python must be able to import it)
## Defaults to: thumbor.loaders.http_loader
LOADER = 'thumbor.loaders.file_loader'

## The file storage thumbor should use to store original images. This must be the
## full name of a python module (python must be able to import it)
## Defaults to: thumbor.storages.file_storage
STORAGE = 'thumbor.storages.file_storage'
STORAGE_BUCKET = ''
RESULT_STORAGE_BUCKET = ''


## The result storage thumbor should use to store generated images. This must be
## the full name of a python module (python must be able to import it)
## Defaults to: None

RESULT_STORAGE = 'thumbor.result_storages.file_storage'


## The imaging engine thumbor should use to perform image operations. This must
## be the full name of a python module (python must be able to import it)
## Defaults to: thumbor.engines.pil
ENGINE = 'thumbor.engines.pil'

## The gif engine thumbor should use to perform image operations. This must be
## the full name of a python module (python must be able to import it)
## Defaults to: 'thumbor.engines.gif'
GIF_ENGINE = 'thumbor.engines.gif'

## The url signer thumbor should use to verify url signatures.This must be the
## full name of a python module (python must be able to import it)
## Defaults to: 'libthumbor.url_signers.base64_hmac_sha1'
URL_SIGNER = 'libthumbor.url_signers.base64_hmac_sha1'

################################################################################


################################### Security ###################################

## 使用密钥加密URL
## Defaults to: MY_SECURE_KEY
SECURITY_KEY = 'MY_SECURE_KEY'

## 设为 True 可支持非密钥(unsafe)访问
## Indicates if the /unsafe URL should be available
## Defaults to: True
ALLOW_UNSAFE_URL = True

## Indicates if encrypted (old style) URLs should be allowed
## Defaults to: True
ALLOW_OLD_URLS = True

## AWS 设置 
## AWS access keys - used in thumbor_aws storage
AWS_ACCESS_KEY = ''
AWS_SECRET_KEY = ''

################################################################################

##################################### HTTP #####################################

## Enables automatically generated etags
## Defaults to: True
ENABLE_ETAGS = True

################################################################################


################################### Storage ####################################

## 图片ID最大长度
## Defaults to: 32
MAX_ID_LENGTH = 32

################################################################################


################################### Metrics ####################################

## 主机监控
## Defaults to: None
STATSD_HOST = None

## 监控端口
## Defaults to: 8125
STATSD_PORT = 8125

## 前缀
## Defaults to: None
STATSD_PREFIX = None

################################################################################

################################# File Loader ##################################

## 加载图片路径
## Defaults to: /tmp
FILE_LOADER_ROOT_PATH = '/data/upload'

################################################################################


################################# HTTP Loader ##################################

## 超时(秒)
## loaded
## Defaults to: 5
HTTP_LOADER_CONNECT_TIMEOUT = 5

## 图片载超时(秒)
## Defaults to: 20
HTTP_LOADER_REQUEST_TIMEOUT = 20

## 开启重试
## Defaults to: True
HTTP_LOADER_FOLLOW_REDIRECTS = True

## 重试次数
## Defaults to: 5
HTTP_LOADER_MAX_REDIRECTS = 5

## 最大并发
## queuing
## Defaults to: 10
HTTP_LOADER_MAX_CLIENTS = 10

## 下面是代理设置

## Indicates whether thumbor should forward the user agent of the requesting user
## Defaults to: False
HTTP_LOADER_FORWARD_USER_AGENT = False

## Default user agent for thumbor http loader requests
## Defaults to: Thumbor/6.3.0
HTTP_LOADER_DEFAULT_USER_AGENT = 'Thumbor/6.3.0'

## The proxy host needed to load images through
## Defaults to: None
HTTP_LOADER_PROXY_HOST = None

## The proxy port for the proxy host
## Defaults to: None
HTTP_LOADER_PROXY_PORT = None

## The proxy username for the proxy host
## Defaults to: None
HTTP_LOADER_PROXY_USERNAME = None

## The proxy password for the proxy host
## Defaults to: None
HTTP_LOADER_PROXY_PASSWORD = None

## 下面是 HTTPS 设置
## The filename of CA certificates in PEM format
## Defaults to: None
HTTP_LOADER_CA_CERTS = None

## Validate the servers certificate for HTTPS requests
## Defaults to: True
HTTP_LOADER_VALIDATE_CERTS = True

## The filename for client SSL key
## Defaults to: None
HTTP_LOADER_CLIENT_KEY = None

## The filename for client SSL certificate
## Defaults to: None
HTTP_LOADER_CLIENT_CERT = None

## If the CurlAsyncHTTPClient should be used
## Defaults to: False
HTTP_LOADER_CURL_ASYNC_HTTP_CLIENT = False


################################################################################


################################# File Storage #################################

## 图像缓存到期时间,默认一个月,单位(秒)
## Defaults to: 2592000
STORAGE_EXPIRATION_SECONDS = 259200

## Indicates whether thumbor should store the signing key for each image in the
## file storage. This allows the key to be changed and old images to still be
## properly found
## Defaults to: False
STORES_CRYPTO_KEY_FOR_EACH_IMAGE = False

## 缓存路径
## Defaults to: /tmp/thumbor/storage
FILE_STORAGE_ROOT_PATH = '/data/storage'

################################################################################


#################################### Upload ####################################

## 是传的最大尺寸
## Aliases: MAX_SIZE
## Defaults to: 0
UPLOAD_MAX_SIZE = 0

## 是否启用文件上传
## Aliases: ENABLE_ORIGINAL_PHOTO_UPLOAD
## Defaults to: False
UPLOAD_ENABLED = False

## The type of storage to store uploaded images with
## Aliases: ORIGINAL_PHOTO_STORAGE
## Defaults to: thumbor.storages.file_storage
UPLOAD_PHOTO_STORAGE = 'thumbor.storages.file_storage'

## 是否可以删除图片
## Aliases: ALLOW_ORIGINAL_PHOTO_DELETION
## Defaults to: False
UPLOAD_DELETE_ALLOWED = False

## 是否可以覆盖图片
## Aliases: ALLOW_ORIGINAL_PHOTO_PUTTING
## Defaults to: False
UPLOAD_PUT_ALLOWED = False

## 默认文件名
## Defaults to: image
UPLOAD_DEFAULT_FILENAME = 'image'

################################################################################

## 下面是各种其它库的存储配置

############################### MongoDB Storage ################################

## MongoDB storage server host
## Defaults to: localhost
MONGO_STORAGE_SERVER_HOST = 'mongo'

## MongoDB storage server port
## Defaults to: 27017
MONGO_STORAGE_SERVER_PORT = 27017

## MongoDB storage server database name
## Defaults to: thumbor
MONGO_STORAGE_SERVER_DB = 'thumbor'

## MongoDB storage image collection
## Defaults to: images
MONGO_STORAGE_SERVER_COLLECTION = 'images'

################################################################################


################################ Redis Storage #################################

## Redis storage server host
## Defaults to: localhost
REDIS_STORAGE_SERVER_HOST = 'redis'

## Redis storage server port
## Defaults to: 6379
REDIS_STORAGE_SERVER_PORT = 6379

## Redis storage database index
## Defaults to: 0
REDIS_STORAGE_SERVER_DB = 0

## Redis storage server password
## Defaults to: None
REDIS_STORAGE_SERVER_PASSWORD = None

################################################################################


################################ Redis Result Storage #################################

## Redis storage server host
## Defaults to: localhost
REDIS_RESULT_STORAGE_SERVER_HOST = 'redis'

## Redis storage server port
## Defaults to: 6379
REDIS_RESULT_STORAGE_SERVER_PORT = 6379

## Redis storage database index
## Defaults to: 0
REDIS_RESULT_STORAGE_SERVER_DB = 0

## Redis storage server password
## Defaults to: None
REDIS_RESULT_STORAGE_SERVER_PASSWORD = None

################################################################################


############################### Memcache Storage ###############################

## List of Memcache storage server hosts
## Defaults to: ['localhost:11211']
MEMCACHE_STORAGE_SERVERS = ['localhost:11211']


################################################################################


################################ Mixed Storage #################################

## Mixed Storage file storage. This must be the full name of a python module
## (python must be able to import it)
## Defaults to: thumbor.storages.no_storage
MIXED_STORAGE_FILE_STORAGE = 'thumbor.storages.no_storage'

## Mixed Storage signing key storage. This must be the full name of a python
## module (python must be able to import it)
## Defaults to: thumbor.storages.no_storage
MIXED_STORAGE_CRYPTO_STORAGE = 'thumbor.storages.no_storage'

## Mixed Storage detector information storage. This must be the full name of a
## python module (python must be able to import it)
## Defaults to: thumbor.storages.no_storage
MIXED_STORAGE_DETECTOR_STORAGE = 'thumbor.storages.no_storage'

################################################################################


##################################### Meta #####################################

## The callback function name that should be used by the META route for JSONP
## access
## Defaults to: None
META_CALLBACK_NAME = None

################################################################################


################################## Detection ###################################

## 人脸识别

## List of detectors that thumbor should use to find faces and/or features. All
## of them must be full names of python modules (python must be able to import
## it)
## Defaults to: []
#DETECTORS =  [
#'thumbor.detectors.queued_detector.queued_complete_detector',
#'thumbor.detectors.queued_detector.queued_face_detector',
#'thumbor.detectors.queued_detector.queued_feature_detector',
#'thumbor.detectors.feature_detector',
#'thumbor.detectors.face_detector',
#]
DETECTORS = []

## The cascade file that opencv will use to detect faces
## Defaults to: haarcascade_frontalface_alt.xml
FACE_DETECTOR_CASCADE_FILE = 'haarcascade_frontalface_alt.xml'

## The cascade file that opencv will use to detect glasses.
## Defaults to: 'haarcascade_eye_tree_eyeglasses.xml'
GLASSES_DETECTOR_CASCADE_FILE = 'haarcascade_eye_tree_eyeglasses.xml'

## The cascade file that opencv will use to detect profile faces.
## Defaults to: 'haarcascade_profileface.xml'
PROFILE_DETECTOR_CASCADE_FILE = 'haarcascade_profileface.xml'

################################################################################


################################## Optimizers ##################################

## List of optimizers that thumbor will use to optimize images
## Defaults to: [] --> ['thumbor.optimizers.jpegtran',]
OPTIMIZERS = []


## Path for the jpegtran binary
## Defaults to: /usr/bin/jpegtran
JPEGTRAN_PATH = '/usr/bin/jpegtran'
PROGRESSIVE_JPEG = True
FFMPEG_PATH = '/usr/bin/ffmpeg' # Default path for the docker installation in debian

################################################################################


################################### Filters ####################################

## 图片过滤器

## List of filters that thumbor will allow to be used in generated images. All of
## them must be full names of python modules (python must be able to import
## it)
## Defaults to: ['thumbor.filters.brightness', 'thumbor.filters.contrast', 'thumbor.filters.rgb', 'thumbor.filters.round_corner', 'thumbor.filters.quality', 'thumbor.filters.noise', 'thumbor.filters.watermark', 'thumbor.filters.equalize', 'thumbor.filters.fill', 'thumbor.filters.sharpen', 'thumbor.filters.strip_icc', 'thumbor.filters.frame', 'thumbor.filters.grayscale', 'thumbor.filters.rotate', 'thumbor.filters.format', 'thumbor.filters.max_bytes', 'thumbor.filters.convolution', 'thumbor.filters.blur', 'thumbor.filters.extract_focal', 'thumbor.filters.no_upscale']
FILTERS = ['thumbor.filters.brightness', 'thumbor.filters.contrast', 'thumbor.filters.rgb', 'thumbor.filters.round_corner', 'thumbor.filters.quality', 'thumbor.filters.noise', 'thumbor.filters.watermark', 'thumbor.filters.equalize', 'thumbor.filters.fill', 'thumbor.filters.sharpen', 'thumbor.filters.strip_icc', 'thumbor.filters.frame', 'thumbor.filters.grayscale', 'thumbor.filters.rotate', 'thumbor.filters.format', 'thumbor.filters.max_bytes', 'thumbor.filters.convolution', 'thumbor.filters.blur', 'thumbor.filters.extract_focal', 'thumbor.filters.no_upscale']

################################################################################


################################ Result Storage ################################

## Expiration in seconds of generated images in the result storage
## Defaults to: 0
RESULT_STORAGE_EXPIRATION_SECONDS = 0

## Path where the Result storage will store generated images
## Defaults to: /tmp/thumbor/result_storage
RESULT_STORAGE_FILE_STORAGE_ROOT_PATH = '/data/result_storage'

## Indicates whether unsafe requests should also be stored in the Result Storage
## Defaults to: False
RESULT_STORAGE_STORES_UNSAFE = False

################################################################################


############################ Queued Redis Detector #############################

## Server host for the queued redis detector
## Defaults to: localhost
REDIS_QUEUE_SERVER_HOST = 'redis'

## Server port for the queued redis detector
## Defaults to: 6379
REDIS_QUEUE_SERVER_PORT = 6379

## Server database index for the queued redis detector
## Defaults to: 0
REDIS_QUEUE_SERVER_DB = 0

## Server password for the queued redis detector
## Defaults to: None
REDIS_QUEUE_SERVER_PASSWORD = None

################################################################################


############################# Queued SQS Detector ##############################

## AWS key id
## Defaults to: None
SQS_QUEUE_KEY_ID = None

## AWS key secret
## Defaults to: None
SQS_QUEUE_KEY_SECRET = None

## AWS SQS region
## Defaults to: us-east-1
SQS_QUEUE_REGION = 'us-east-1'

################################################################################


#################################### Errors ####################################

## This configuration indicates whether thumbor should use a custom error
## handler.
## Defaults to: False
USE_CUSTOM_ERROR_HANDLING = False

## Error reporting module. Needs to contain a class called ErrorHandler with a
## handle_error(context, handler, exception) method.
## Defaults to: thumbor.error_handlers.sentry
ERROR_HANDLER_MODULE = 'thumbor.error_handlers.sentry'

## File of error log as json
## Defaults to: None
ERROR_FILE_LOGGER = None

## File of error log name is parametrized with context attribute
## Defaults to: False
ERROR_FILE_NAME_USE_CONTEXT = False

################################################################################


############################### Errors - Sentry ################################

## Sentry thumbor project dsn. i.e.: http://5a63d58ae7b94f1dab3dee740b301d6a:73ee
## a45d3e8649239a973087e8f21f98@localhost:9000/2
## Defaults to:
SENTRY_DSN_URL = ''

################################################################################

################################### General ####################################

## Custom app class to override ThumborServiceApp. This config value is
## overridden by the -a command-line parameter.
## Defaults to: 'thumbor.app.ThumborServiceApp'
APP_CLASS = 'thumbor.app.ThumborServiceApp'

################################################################################

############################## TC_AWS ##########################################
TC_AWS_REGION = 'eu-west-1' # AWS Region

TC_AWS_ENDPOINT = None # Custom S3 endpoint URL (for GCP, Minio, etc.)

TC_AWS_STORAGE_BUCKET = '' # S3 bucket for Storage
TC_AWS_STORAGE_ROOT_PATH = '' # S3 path prefix for Storage bucket

TC_AWS_LOADER_BUCKET = '' #S3 bucket for loader
TC_AWS_LOADER_ROOT_PATH = '' # S3 path prefix for Loader bucket

TC_AWS_RESULT_STORAGE_BUCKET = '' # S3 bucket for result Storage
TC_AWS_RESULT_STORAGE_ROOT_PATH = '' # S3 path prefix for Result storage bucket

# put data into S3 using the Server Side Encryption functionality to
# encrypt data at rest in S3
# https://aws.amazon.com/about-aws/whats-new/2011/10/04/amazon-s3-announces-server-side-encryption-support/
TC_AWS_STORAGE_SSE = False

# put data into S3 with Reduced Redundancy
# https://aws.amazon.com/about-aws/whats-new/2010/05/19/announcing-amazon-s3-reduced-redundancy-storage/
TC_AWS_STORAGE_RRS = False


# Enable HTTP Loader as well?
# This would allow you to load watermarks in over your images dynamically through a URI
# E.g.
# http://your-thumbor.com/unsafe/filters:watermark(http://example.com/watermark.png,0,0,50)/s3_bucket/photo.jpg
TC_AWS_ENABLE_HTTP_LOADER = False

TC_AWS_ALLOWED_BUCKETS = False # List of allowed bucket to be requested
TC_AWS_STORE_METADATA = False # Store result with metadata (for instance content-type)
################################################################################

中文thumbor教程地址 https://s0web0dev.icopy.site/use-thumbor/

我的gihub地址

https://github.com/datayang/mino-thumbor-openresty

参考:
地址1

地址2

地址3

地址4

已有 2 条评论
发表新评论