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:
parent
d4246a08fd
commit
30534fb6d4
1 changed files with 13 additions and 9 deletions
20
README.md
20
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;
|
||||
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/;
|
||||
}
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in a new issue