added option to specify upstream scheme in proxy define. Still needs testing