0
Fork 0
mirror of https://github.com/willnorris/imageproxy.git synced 2024-12-16 21:56:43 -05:00

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
This commit is contained in:
Will Norris 2019-05-12 11:09:26 -07:00
parent d4246a08fd
commit 30534fb6d4

View file

@ -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;
location /api/imageproxy/ {
proxy_pass http://localhost:4593/;
}
proxy_pass http://localhost:8080;
```
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/;
}
```