Skip to content
Permalink
Browse files

Added merge_slashes off to the Nginx config instead of regex in njs s…

…cript
  • Loading branch information...
korneevm committed Mar 30, 2019
1 parent 66f80de commit 61321fc361dc969403b0ca35bc511b385aee1087
Showing with 2 additions and 1 deletion.
  1. +1 −1 nginx-proxy/imgpath.js
  2. +1 −0 nginx-proxy/nginx.tmpl
@@ -1,5 +1,5 @@
function file_path(r) {
var uri = decodeURI(r.uri).replace(/(https?):\/(\w)/i, '$1://$2');
var uri = decodeURI(r.uri);
var digest = require('crypto').createHash('sha1').update(uri).digest('hex');
return digest.slice(NaN, 2) + "/" + digest.slice(2, 4) + "/" + digest.slice(4);
}
@@ -1,6 +1,7 @@
{{ $CurrentContainer := where $ "ID" .Docker.CurrentContainerID | first }}

{{ define "thumbor-include" }}
merge_slashes off;
js_include imgpath.js;
js_set $file_path file_path;
{{ end }}

0 comments on commit 61321fc

Please sign in to comment.
You can’t perform that action at this time.