2018-10-04 18:59:57 +06:00
# Serving local files
2018-10-08 12:23:20 +06:00
imgproxy can be configured to process files from your local filesystem. To use this feature, do the following:
2018-10-04 18:59:57 +06:00
2018-10-08 12:23:20 +06: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 18:59:57 +06:00
### Example
2022-02-01 12:43:36 +03:00
Assume you want to process an image that is 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 18:59:57 +06:00
```bash
2019-10-15 21:48:33 +06:00
IMGPROXY_LOCAL_FILESYSTEM_ROOT=/path/to/project/images imgproxy
2018-10-04 18:59:57 +06:00
```
2022-02-01 12:43:36 +03:00
Then, use the path inside this directory as the source URL:
2018-10-04 18:59:57 +06:00
```
local:///logos/evil_martians.png
```
2022-02-01 12:43:36 +03:00
The URL for resizing this image to fit 300x200 will look like this:
2018-10-04 18:59:57 +06:00
```
2021-11-26 13:19:20 +00:00
http://imgproxy.example.com/insecure/rs:fit:300:200:no:0/plain/local:///logos/evil_martians.png@jpg
2018-10-04 18:59:57 +06:00
```