@@ -3,7 +3,7 @@ oauth2_proxy
4<small>(This project was renamed from Google Auth Proxy - May 2015)</small>
4<small>(This project was renamed from Google Auth Proxy - May 2015)</small>
6−A reverse proxy that provides authentication using Providers (Google, Github, and others)
6+A reverse proxy and static file server that provides authentication using Providers (Google, Github, and others)
7to validate accounts by email, domain or group.
7to validate accounts by email, domain or group.
9[](http://travis-ci.org/bitly/oauth2_proxy)
9[](http://travis-ci.org/bitly/oauth2_proxy)
@@ -152,13 +152,21 @@ Usage of oauth2_proxy:
152 -skip-auth-regex=: bypass authentication for requests path's that match (may be given multiple times)
152 -skip-auth-regex=: bypass authentication for requests path's that match (may be given multiple times)
153 -tls-cert="": path to certificate file
153 -tls-cert="": path to certificate file
154 -tls-key="": path to private key file
154 -tls-key="": path to private key file
155− -upstream=: the http url(s) of the upstream endpoint. If multiple, routing is based on path
155+ -upstream=: the http url(s) of the upstream endpoint or file:// paths for static files. Routing is based on the path
156 -validate-url="": Access token validation endpoint
156 -validate-url="": Access token validation endpoint
157 -version=false: print version string
157 -version=false: print version string
160See below for provider specific options
160See below for provider specific options
162+### Upstreams Configuration
164+`oauth2_proxy` supports having multiple upstreams, and has the option to pass requests on to HTTP(S) servers or serve static files from the file system. HTTP and HTTPS upstreams are configured by providing a URL such as `http://127.0.0.1:8080/` for the upstream parameter, that will forward all authenticated requests to be forwarded to the upstream server. If you instead provide `http://127.0.0.1:8080/some/path/` then it will only be requests that start with `/some/path/` which are forwarded to the upstream.
166+Static file paths are configured as a file:// URL. `file:///var/www/static/` will serve the files from that directory at `http://[oauth2_proxy url]/var/www/static/`, which may not be what you want. You can provide the path to where the files should be available by adding a fragment to the configured URL. The value of the fragment will then be used to specify which path the files are available at. `file:///var/www/static/#/static/` will ie. make `/var/www/static/` available at `http://[oauth2_proxy url]/static/`.
168+Multiple upstreams can either be configured by supplying a comma separated list to the `-upstream` parameter, supplying the parameter multiple times or provinding a list in the [config file](#config-file). When multiple upstreams are used routing to them will be based on the path they are set up with.
162### Environment variables
170### Environment variables
164The environment variables `OAUTH2_PROXY_CLIENT_ID`, `OAUTH2_PROXY_CLIENT_SECRET`, `OAUTH2_PROXY_COOKIE_SECRET`, `OAUTH2_PROXY_COOKIE_DOMAIN` and `OAUTH2_PROXY_COOKIE_EXPIRE` can be used in place of the corresponding command-line arguments.
172The environment variables `OAUTH2_PROXY_CLIENT_ID`, `OAUTH2_PROXY_CLIENT_SECRET`, `OAUTH2_PROXY_COOKIE_SECRET`, `OAUTH2_PROXY_COOKIE_DOMAIN` and `OAUTH2_PROXY_COOKIE_EXPIRE` can be used in place of the corresponding command-line arguments.