Nginx template file loader now allows you to configure set $template_location, and if defined it will use ngx.location.capture.