imazen / imageflow

High-performance image manipulation for web servers. Includes imageflow_server, imageflow_tool, and libimageflow
https://docs.imageflow.io/
GNU Affero General Public License v3.0
4.14k stars 140 forks source link

How to use permacache_proxy #550

Closed max-frai closed 3 years ago

max-frai commented 3 years ago

Hello, I want to serve images from static folder with results caching. I try the following run command (on macos):

cargo run --bin imageflow_server start --port 4243  --data-dir=./imageflow_data --mount /js/:permacache_proxy:./js

So I have js and imageflow_data folders. js folder has test.jpg file.

I try to access it: http://localhost:4243/js/test.jpg?width=300 which leads to error:

Internal Server Error
Info:"./jstest.jpgwidth=300"
Error:UpstreamReqwestError(Error(Url(RelativeUrlWithoutBase)))

What's wrong?

lilith commented 3 years ago

permacache_proxy proxies http content from another server. It doesn't serve static files.

lilith commented 3 years ago

You can use the static handler for images, but imageflow_server is not a general purpose HTTP server.

I would suggest using Imageflow.NET Server as it can serve arbitrary file types alongside image resizing.

lilith commented 3 years ago

Feel free to reopen if you have any follow up questions