Unfortunately, it assumes one link in the proto and host chain.
If your LB passes x-forwarded-* headers correctly, it joins the new value against an existing header. So assuming you have one LB terminating SSL followed by a second LB (to balance couch, for example), your x-forwarded-proto value will likely be https, http. The couchapp blindly uses the string which means your rewrites resolve to https, http://1.2.3.4/file/-/file-0.0.0.tgz.
This is a hack to get around that. Best place to fix will be the couchapp.
I kept x-forwarded-for in case that chain will be valuable.
This was fun.
Turns out the couchapp already handles host rewrites which is cool (they implemented it two months before we did).
Unfortunately, it assumes one link in the proto and host chain.
If your LB passes x-forwarded-* headers correctly, it joins the new value against an existing header. So assuming you have one LB terminating SSL followed by a second LB (to balance couch, for example), your
x-forwarded-proto
value will likely behttps, http
. The couchapp blindly uses the string which means your rewrites resolve tohttps, http://1.2.3.4/file/-/file-0.0.0.tgz
.This is a hack to get around that. Best place to fix will be the couchapp.
I kept
x-forwarded-for
in case that chain will be valuable.