From 30534fb6d4869bea75631c83b10a39ad1ba56c11 Mon Sep 17 00:00:00 2001 From: Will Norris Date: Sun, 12 May 2019 11:09:26 -0700 Subject: [PATCH] readme: suggest a simpler nginx config the old nginx config was designed to prevent url canonicalization, which is no longer a concern, and was causing problems with non-latin characters. Fixes #178 --- README.md | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 29f3ab4..496866d 100644 --- a/README.md +++ b/README.md @@ -323,17 +323,21 @@ ENTRYPOINT ["/go/bin/imageproxy", "-addr 0.0.0.0:8080"] ### nginx ### -You can use follow config to prevent URL overwritting: +Use the `proxy_pass` directive to send requests to your imageproxy instance. +For example, to run imageproxy at the path "/api/imageproxy/", set: ``` - 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; + location /api/imageproxy/ { + proxy_pass http://localhost:4593/; + } +``` + +Depending on other directives you may have in your nginx config, you might need +to alter the precedence order by setting: + +``` + location ^~ /api/imageproxy/ { + proxy_pass http://localhost:4593/; } ```