<titledata-react-helmet="true">TLS Configuration | OAuth2 Proxy</title><metadata-react-helmet="true"name="twitter:card"content="summary_large_image"><metadata-react-helmet="true"property="og:url"content="https://oauth2-proxy.github.io/oauth2-proxy/docs/next/configuration/tls"><metadata-react-helmet="true"name="docusaurus_locale"content="en"><metadata-react-helmet="true"name="docusaurus_version"content="current"><metadata-react-helmet="true"name="docusaurus_tag"content="docs-default-current"><metadata-react-helmet="true"property="og:title"content="TLS Configuration | OAuth2 Proxy"><metadata-react-helmet="true"name="description"content="There are two recommended configurations:"><metadata-react-helmet="true"property="og:description"content="There are two recommended configurations:"><linkdata-react-helmet="true"rel="icon"href="/oauth2-proxy/img/logos/OAuth2_Proxy_icon.svg"><linkdata-react-helmet="true"rel="canonical"href="https://oauth2-proxy.github.io/oauth2-proxy/docs/next/configuration/tls"><linkdata-react-helmet="true"rel="alternate"href="https://oauth2-proxy.github.io/oauth2-proxy/docs/next/configuration/tls"hreflang="en"><linkdata-react-helmet="true"rel="alternate"href="https://oauth2-proxy.github.io/oauth2-proxy/docs/next/configuration/tls"hreflang="x-default"><linkrel="stylesheet"href="/oauth2-proxy/assets/css/styles.19258e03.css">
Regardless of the minimum version configured, <code>TLS1.3</code> is currently always used as the maximal version.</p><p>TLS server side cipher suites can be specified with <code>--tls-cipher-suite=TLS_RSA_WITH_RC4_128_SHA</code>.
If not specified, the defaults from <ahref="https://pkg.go.dev/crypto/tls#CipherSuites"target="_blank"rel="noopener noreferrer"><code>crypto/tls</code></a> of the currently used <code>go</code> version for building <code>oauth2-proxy</code> will be used.
A complete list of valid TLS cipher suite names can be found in <ahref="https://pkg.go.dev/crypto/tls#pkg-constants"target="_blank"rel="noopener noreferrer"><code>crypto/tls</code></a>.</p></li></ol><h3class="anchor anchorWithStickyNavbar_mojV"id="terminate-tls-at-reverse-proxy-eg-nginx">Terminate TLS at Reverse Proxy, e.g. Nginx<aclass="hash-link"href="#terminate-tls-at-reverse-proxy-eg-nginx"title="Direct link to heading"></a></h3><ol><li><p>Configure SSL Termination with <ahref="http://nginx.org/"target="_blank"rel="noopener noreferrer">Nginx</a> (example config below), Amazon ELB, Google Cloud Platform Load Balancing, or ...</p><p>Because <code>oauth2-proxy</code> listens on <code>127.0.0.1:4180</code> by default, to listen on all interfaces (needed when using an
external load balancer like Amazon ELB or Google Platform Load Balancing) use <code>--http-address="0.0.0.0:4180"</code> or
<code>--http-address="http://:4180"</code>.</p><p>Nginx will listen on port <code>443</code> and handle SSL connections while proxying to <code>oauth2-proxy</code> on port <code>4180</code>.
<code>oauth2-proxy</code> will then authenticate requests for an upstream application. The external endpoint for this example
would be <code>https://internal.yourcompany.com/</code>.</p><p>An example Nginx config follows. Note the use of <code>Strict-Transport-Security</code> header to pin requests to SSL