2018-10-04 14:59:57 +02:00
# Serving local files
2018-10-08 08:23:20 +02:00
imgproxy can be configured to process files from your local filesystem. To use this feature, do the following:
2018-10-04 14:59:57 +02:00
2018-10-08 08:23:20 +02:00
1. Set `IMGPROXY_LOCAL_FILESYSTEM_ROOT` environment variable to your local images directory path.
2. Use `local:///path/to/image.jpg` as the source image URL.
2018-10-04 14:59:57 +02:00
### Example
2018-10-08 08:23:20 +02:00
Assume you want to process an image that stored locally at `/path/to/project/images/logos/evil_martians.png` . Run imgproxy with `IMGPROXY_LOCAL_FILESYSTEM_ROOT` set to your images directory:
2018-10-04 14:59:57 +02:00
```bash
$ IMGPROXY_LOCAL_FILESYSTEM_ROOT=/path/to/project/images imgproxy
```
2018-10-08 08:23:20 +02:00
Then use path inside this directory as the source URL:
2018-10-04 14:59:57 +02:00
```
local:///logos/evil_martians.png
```
The URl for resizing this image to fit 300x200 will look like this:
```
http://imgproxy.example.com/insecure/fit/300/200/no/0/bG9jYWw6Ly8vbG9n/b3MvZXZpbF9tYXJ0/aWFucy5wbmc.jpg
```