title: HTTPS/SSL Certificates and traffic on Azure - From CDN (custom domain with SSL) to Traffic Manager and end to end flow
body: <p>We have been working on a flow of upstream services on Azure. The following is the architecture:</p>
  
  <p><strong>User -> DNS -> Azure CDN -> Azure Traffic Manager -> Frontend Load Balancer (Firewall NVA) -> Azure Application Gateway -> Backend Pool (VM-Webserver)</strong></p>
  
  <p>The above flow was designed for a client and we are provisioning the same. The entire end to end flow works with HTTP requests.</p>
  
  <p>But for HTTPS with SSL, the flow works only till traffic manager, as soon as we add CDN in the flow, it gives error, 'Request cannot be served', when checked in browser, it shows 502 bad gateway in developer tools</p>
  
  <p>What we have seen so far:</p>
  
  <ol>
  <li>The end to end flow is working seamless for HTTP requests For</li>
  <li>HTTPs/SSL requests following configs have been done:<br>
  a) CDN : We have a profile with Custom Domain and HTTPS and Certificate enabled over it.The profile has both 80,443 enabled<br>
  b) Traffic manager : Endpoint set to port 443<br>
  c) Application Gateway : Plan to use end to end SSL encryption<br>
     i) Listener is on 443 port and has a pfx certificate<br>
     ii) HTTP setting with HTTPS and has a cer certificate from the original webserver</li>
  </ol>
  
  <p>We have tried different combinations of configuration with CDN and traffic manager but doesn't seem to be working. I need this flow to be working end to end for HTTPS requests. This is for a prod migration to Azure.</p>