changqian9 / cloudcdn-signed-cookie-nginx

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is not an officially supported Google product.

See LICENSE for license information.

  • Background

This repo holds example nginx javascript code to generate SignedCookie for use with GCP's CloudCDN.

  • Usage

To use the container image generated by the Dockerfile, you need to create(and adjust) a secret with the following content:

#!/bin/bash
export SIGNKEY="the signing key"
export KEYNAME="keyname"
export DOMAIN="example.com"
export EXPIRES="1200"
export LOCATION_REGEXP=".*"
export BACKEND_SERVER="someipaddress:80"

When you run the container, pass the name of the secret to the container through an env named SECRETNAME. Remember to grant access to the secret to the VM(s) running the container.

Otherwise just use the js file and nginx config files in the nginx directory.

About

License:Apache License 2.0


Languages

Language:JavaScript 44.9%Language:Python 26.0%Language:Shell 16.2%Language:Dockerfile 12.9%