Closed pixiemediaweb closed 1 year ago
For supporting multiple folders and websites, we have a discussion at https://github.com/webp-sh/webp_server_go/issues/217, we can discuss there.
Closing this PR now as we've Multipath feature starting from version 0.9.9, docs: https://docs.webp.sh/usage/multipath/.
It would be great to be able to pass the IMG_PATH variable from nginx to the config so we can support multiple folders and websites from a single implementation.
For example something like this;
location ^~ /media/resized/ { location ~* .(jpg|jpeg|png|gif)$ {
expires 30d; proxy_pass http://127.0.0.1:3333; set $IMAGE_PATH '/var/www/folder', proxy_buffer_size 128k; proxy_buffers 4 256k; proxy_busy_buffers_size 256k; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Forwarded-Port 443; proxy_set_header Host $host; proxy_read_timeout 3600; }
Which would then be picked up by the config.json something like this;
{ "HOST": "127.0.0.1", "PORT": "3333", "QUALITY": "80", "IMG_PATH": $IMAGE_PATH, "EXHAUST_PATH": "/var/www/webpcache", "ALLOWED_TYPES": ["jpg","png","jpeg","bmp","gif"], "ENABLE_AVIF": false }