title: Using Varnish with SaaS HTTPS backend servers?
body: <p>I want to configure Varnish to use HTTPS(!) services as backend services. The key here is the SSL part of the connection to the backend service! I have limited control over those HTTPS backend services (think of them as SaaS services hosted in the cloud). </p>
  
  <p>It's a setup like this: User-Agent -> AWS ELB as SSL terminator -> Varnish in AWS -> HTTPS SaaS services in the cloud</p>
  
  <p>The reasons for that are as follows:
  - I want to use Varnish ESI to decorate the SaaS service UI with my own custom page header &amp; footer.
  - By having all requests going through Varnish, I get additional analytics data about the SaaS service which I wouldn't get otherwise
  - I can use Varnish to re-write URLs of the SaaS service effectively hiding the SaaS service URL from the end-users</p>
  
  <p>I am able to use AWS ELB as SSL terminator towards the user-agent, but how do I get Varnish to access the HTTPS SaaS service as an origin server?</p>
  
  <p>Background:
  I work on a web portal where we will present a number of different services (all services have their own existing UI, i.e. they don't have headless RESP APIs!) to our customers. The main thing that pulls all those services together is a common page header and footer (page header shows top level navigation and login/username logout).</p>
  
  <p>The types of services we have are as follows, all have their own UI layer which we don't want to replicate:
  - White-labeled 3rd party SaaS service (think of e.g. Zendesk or Salesforce), hosted in the cloud
  - In-house developed JavaEE/Spring services which are hosted in AWS
  - Services that other teams in our company developed, but they are hosted in our own data center</p>
  
  <p>Adding ESI includes is fine for each of those services, but I don't want to have to duplicate work of re-implementing the page header/footer multiple times for each service.</p>