Search code examples
google-app-enginesslhttpsapp-engine-flexiblefastly

App Engine flexible behind a CDN (Fastly)


We are running an App Engine Flexible app behind with Fastly (CDN) on the front. We have set up ghs.googlehosted.com as the origin server, so the CDN forwards the request to that server if it doesn't have the cached version. This has been running fine for months.

However, we want now to ensure Fastly connects to the origin (ghs.googlehosted.com) over TLS. It seems ghs.googlehosted.com does not support TLS. Any ideas of how to overcome this situation?


Solution

  • So far, this is what we have found out when choosing the origin host of our CDN (Fastly):

    • myapp.appspot.com: Supports TLS but requires the Host HTTP header to be exactly myapp.appspot.com. Therefore, the Host header needs to be overridden.
    • ghs.googlehosted.com: Does not support TLS, but accepts any Host HTTP header, so you can use any of your App Engine custom domains.

    More info in this thread in the App Engine group.

    Edit: I was missing sending the SNI in the request. Now it works well with ghs.googlehosted.com and TLS.