From 94dbd77d6ef8e8b600a258f80b5a24dc1846755e Mon Sep 17 00:00:00 2001 From: Denis Izmaylov Date: Sun, 1 May 2016 08:55:03 +0300 Subject: [PATCH] Add points about nginx and Dockerfile --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 8f6bf7a..6cd8ec3 100644 --- a/README.md +++ b/README.md @@ -291,6 +291,28 @@ You can run it by 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 ## imageproxy is copyright Google, but is not an official Google product. It is