https://github.com/nullstone-modules/gcp-gcs-cdn
Creates a CDN for a Nullstone static site that is hosted using Google Cloud Storage
https://github.com/nullstone-modules/gcp-gcs-cdn
Last synced: 4 months ago
JSON representation
Creates a CDN for a Nullstone static site that is hosted using Google Cloud Storage
- Host: GitHub
- URL: https://github.com/nullstone-modules/gcp-gcs-cdn
- Owner: nullstone-modules
- License: mit
- Created: 2024-03-27T14:36:49.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-12-13T17:50:42.000Z (over 1 year ago)
- Last Synced: 2026-01-30T14:56:16.088Z (4 months ago)
- Language: HCL
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# gcp-gcs-cdn
Creates a Content Distribution Network (CDN) for a Nullstone static site that is hosted using Google Cloud Storage.
This adds a security layer and caching for serving static assets.
## Subdomain connection
This module requires connection a subdomain.
The subdomain address is automatically connected to the created Cloud CDN.
## HTTPS
This connection is also used to create an HTTPS connection.
The CDN is configured to redirect HTTP:80 traffic to HTTPS:443 by serving HTTP traffic with `HTTP 301 (Moved Permanently)`.
## Versioned Assets
For a static site that has versioned assets enabled, the assets for each code version are stored in a directory within Google Cloud Storage.
This module automatically configures the routing of requests to the assets directory for the live code version.
Let's look at an example where a user requests `//`.
If the code version of the app is `9ff6494`, the CDN will serve `9ff6494///` from the Google Cloud Storage (GCS) bucket.
## Environment File
This module also configures the CDN to serve an environment file (`env.json`) in json format containing environment variables from the application.
As opposed to versioned assets, this env file is stored in the root of the Google Cloud Storage (GCS) bucket.