Add support for configuring 'secure_rewrites', close #7