cfaccessproxy
is a simple reverse proxy that authenticates
Cloudflare Access requests.
-
Install the latest version of Go if you haven't yet.
-
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.
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). |