Skip to content
This repository has been archived by the owner on Sep 12, 2021. It is now read-only.

astrophena/cfaccessproxy

Repository files navigation

cfaccessproxy

cfaccessproxy is a simple reverse proxy that authenticates Cloudflare Access requests.

Installation

  1. Install the latest version of Go if you haven't yet.

  2. Install with go get:

     $ pushd $(mktemp -d); go mod init tmp; go get go.astrophena.name/cfaccessproxy; popd
    

    go get puts binaries by default to $GOPATH/bin (e.g. ~/go/bin).

    Use GOBIN environment variable to change this behavior.

Configuration

cfaccessproxy is configured via environment variables.

Name Description
CFACCESSPROXY_ADDR Address to listen on (optional, :3000 by default).
CFACCESSPROXY_BASE_URL Base URL (used for canonical redirection, required).
CFACCESSPROXY_UPSTREAM URL to proxy requests (required).
CFACCESSPROXY_AUTH_DOMAIN Cloudflare Access domain (e. g. *.cloudflareaccess.com) (required).
CFACCESSPROXY_POLICY_AUD Application AUD from Cloudflare Access (required).
CFACCESSPROXY_BYPASS_PREFIXES Comma-separated list of URL prefixes that should bypass JWT check (optional).
CFACCESSPROXY_LOGOUT_REDIRECT Whether to redirect /logout to Cloudflare Access logout (false by default).

License

MIT © Ilya Mateyko