mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-05-11 04:52:39 +02:00
Add points about nginx and Dockerfile
This commit is contained in:
parent
49480c4693
commit
94dbd77d6e
1 changed files with 22 additions and 0 deletions
22
README.md
22
README.md
|
|
@ -291,6 +291,28 @@ You can run it by
|
||||||
docker run -p 8080:8080 willnorris/imageproxy -addr 0.0.0.0:8080
|
docker run -p 8080:8080 willnorris/imageproxy -addr 0.0.0.0:8080
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Or in your Dockerfile:
|
||||||
|
|
||||||
|
```
|
||||||
|
ENTRYPOINT ["/go/bin/imageproxy", "-addr 0.0.0.0:8080"]
|
||||||
|
```
|
||||||
|
|
||||||
|
## nginx
|
||||||
|
|
||||||
|
You can use follow config to prevent URL overwritting:
|
||||||
|
|
||||||
|
```
|
||||||
|
location ~ ^/api/imageproxy/ {
|
||||||
|
# pattern match to capture the original URL to prevent URL
|
||||||
|
# canonicalization, which would strip double slashes
|
||||||
|
if ($request_uri ~ "/api/imageproxy/(.+)") {
|
||||||
|
set $path $1;
|
||||||
|
rewrite .* /$path break;
|
||||||
|
}
|
||||||
|
proxy_pass http://localhost:8080;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## License ##
|
## License ##
|
||||||
|
|
||||||
imageproxy is copyright Google, but is not an official Google product. It is
|
imageproxy is copyright Google, but is not an official Google product. It is
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue