Giter VIP home page Giter VIP logo

appengine-hosting's Introduction

appengine-hosting

Google Cloud Storage allows you to configure a bucket to host a static website, with one big caveat: no HTTPS support.

Proposed solutions are: a load balancer, a third-party CDN, and Firebase Hosting.

This offers an additional, cost effective, customizable, alternative: a single App Engine app that can host as many static websites as needed.

How and why?

A Go, App Engine app, serves static content from Cloud Storage buckets. Always Free mean you can host this for free, and scale up from there.

Follow the Quickstart for Go App Engine Standard Environment tutorial. Choose the us-central region if you want to take full advantage of Always Free. Don't clean up.

Follow the Hosting a Static Website tutorial. Use the same project as above. For best performance, place the bucket in the same region as above (pick us-central1 for the Always Free allowance). Verify that everything works as expected through the custom domain. Don't clean up.

Now, clone this repository and deploy it to App Engine. Then, map the custom domain for the website to the App Engine app. Wait for the managed SSL certificate to be provisioned for your app, or configure your own SSL certificate.

You should now be able to use HTTPS to access the website.

What works, and what doesn't?

  • Website configuration for the bucket (Main page, and 404 page) is respected by default.
  • Multiple domains can be mapped to the app, content will be served from the corresponding buckets.
  • All HTTP traffic is 301 redirected to HTTPS (see app.yaml)
  • Some security headers are added, many Cloud Storage headers are hidden.
  • Redirects, rewrites, etc, as in Firebase Hosting (see firebase-sample.json).
  • This issue means compressed objects in Cloud Storage larger than 32Mb are not supported (don't use gsutil -z or -Z to upload them).
  • This issue is fixed.

appengine-hosting's People

Contributors

ncruces avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

appengine-hosting's Issues

Sites are very slow if 404 set to same as index

Not sure if this could be a warning upon running the app or otherwise be preventable in any way, but I accidentally had the index and 404 pages set to the same HTML file and the site would take upwards of a second to respond - when I changed the 404 page to something else it was suddenly lightning fast.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.