User and operator guide · Deployment

Reverse Proxy And TLS Configuration

Status: currentReviewed: 2026-07-10Audience: platform engineers, deployment engineers, security engineers
On this pageReference TopologyPublic URL SettingsRequired Header BehaviorHeaders To Strip From Client RequestsTLS RequirementsPublic ListenerUpstream To Atlas GatewayCookie And Session BehaviorWebSocket BehaviorSAML, OIDC, And WebAuthn ConsiderationsSAMLOIDC App LaunchWebAuthnBrowser CAC/PIVNGINX Reference ConfigurationKubernetes Ingress NotesLoad Balancer And WAF NotesValidation ProcedureTroubleshootingDeployment Evidence Checklist

Use this page when Atlas is installed behind an enterprise reverse proxy, load balancer, Kubernetes Ingress, WAF, or service-mesh gateway.

Atlas can serve the browser UI and API directly, but most enterprise deployments place the public hostname at an edge tier and forward to the Atlas gateway. That edge tier becomes part of the authentication boundary. It must preserve the external URL context, protect TLS, pass authentication/session headers, support WebSocket upgrades when enabled, and strip spoofable client-supplied forwarding or identity headers.

Important

Do not deploy Atlas behind a reverse proxy that rewrites the browser-visible host, scheme, or callback URLs without updating Atlas public URL settings.

SAML metadata, SAML SSO, OIDC launch token endpoints, WebAuthn origins, cookies, CORS, HSTS, and audit client-IP evidence all depend on consistent public URL handling.

Reference Topology

Reverse Proxy Topology
Reverse Proxy TopologyArchitecture diagramOpen full size ↗

The recommended production topology is:

  • Browser to edge: HTTPS on the public Atlas hostname.

  • Edge to Atlas gateway: HTTPS with certificate validation, preferably mTLS or private network enforcement.

  • Atlas gateway to internal services: the configured Atlas service security model, including TLS/mTLS where enabled.

For non-development environments, Atlas configuration validation requires api_gateway.tls_enabled=true. If the edge terminates browser TLS, keep TLS enabled on the gateway upstream as well unless a formally approved platform boundary documents a different control.

Public URL Settings

Configure Atlas with the browser-visible external origin. Do not use internal service DNS names in public metadata or browser callback settings.

Setting Purpose Required value behind a reverse proxy

ATLAS_PUBLIC_BASE_URL

Fallback public base URL for browser-visible metadata and SAML IdP URLs.

https://<atlas-public-host>;

ATLAS_SAML_IDP_BASE_URL

Overrides the SAML IdP metadata and SSO base URL.

https://<atlas-public-host>; when Atlas is an IdP.

ATLAS_BROWSER_BASE_URL

Adds a browser origin for WebAuthn and browser-based validation flows.

https://<atlas-public-host>;

ATLAS_APP_LAUNCH_TOKEN_ENDPOINT

Overrides the OIDC app launch token endpoint when Host/proxy headers cannot be trusted.

https://<atlas-public-host>/api/v1/me/apps/oidc/token

api_gateway.allowed_origins

CORS/WebSocket allowed browser origins.

Exact HTTPS origins only, for example https://atlas.example.mil.

api_gateway.client_certificate_auth.browser_base_url

Public URL for the browser CAC/PIV client-certificate listener when enabled.

HTTPS URL on the certificate-auth hostname or port.

Production api_gateway.allowed_origins must not contain *, and each origin must use HTTPS. This is enforced by Atlas configuration validation outside development-like environments.

Required Header Behavior

The reverse proxy must set these headers before forwarding to Atlas:

Header Required behavior Why it matters

Host

Preserve the original public host, including port when non-default.

Atlas uses r.Host for browser-visible OIDC app launch token endpoints when ATLAS_APP_LAUNCH_TOKEN_ENDPOINT is not set. SAML, WebAuthn, redirects, cookies, and audit context also depend on stable host handling.

X-Forwarded-Proto

Set to https for public HTTPS requests.

Atlas emits HSTS and marks browser session cookies secure when it sees TLS or X-Forwarded-Proto: https.

X-Forwarded-For

Set to the external client IP chain after stripping any client-supplied value.

Atlas uses this for authentication audit and rate-limiting context only when the direct peer is a trusted proxy address.

X-Real-IP

Set to the single external client IP after stripping any client-supplied value.

Fallback client-IP source for audit/rate limiting when X-Forwarded-For is absent.

X-Forwarded-Host

Set to the public host when the platform standard requires it.

Useful for diagnostics and downstream integrations, but Atlas primarily relies on Host in reviewed code paths.

X-Forwarded-Port

Set to the public port when non-default.

Helps operators diagnose public URL mismatches.

Origin

Preserve the browser-sent origin.

CORS and WebSocket origin checks depend on the real browser origin.

Authorization

Do not strip.

API clients and bearer-token flows require it.

Cookie

Do not strip.

Browser sessions, step-up, SSO handoff, and trusted-device flows require cookies.

Set-Cookie

Do not rewrite Secure, HttpOnly, or SameSite attributes.

Atlas deliberately sets browser session cookie security attributes.

Upgrade

Preserve for WebSocket paths.

Required for /ws/trust-scores when WebSockets are enabled.

Connection

Set to upgrade for WebSocket upgrade requests.

Required for WebSocket tunnel establishment.

Headers To Strip From Client Requests

Before setting trusted proxy headers, the edge must remove any client-supplied version of:

  • Forwarded

  • X-Forwarded-For

  • X-Forwarded-Host

  • X-Forwarded-Port

  • X-Forwarded-Proto

  • X-Real-IP

  • X-Client-Cert

  • X-SSL-Client-Cert

  • X-Forwarded-Client-Cert

  • X-Atlas-User

  • X-Atlas-Email

  • X-Atlas-Groups

  • X-Atlas-Trust-Score

Atlas uses X-Forwarded-For and X-Real-IP only when the direct peer is loopback, private, or link-local. That prevents normal public clients from spoofing forwarded IPs, but the edge must still strip and rewrite forwarding headers so there is exactly one trusted source of client network evidence.

Never pass X-Atlas-* identity headers from the public client side. Those headers are reserved for Atlas-controlled proxy-header application integrations and must be generated only inside a documented trusted proxy boundary.

TLS Requirements

Public Listener

The public reverse-proxy listener must:

  • use a certificate whose SAN covers the public Atlas hostname

  • serve the complete certificate chain

  • redirect HTTP to HTTPS, or block HTTP entirely

  • prefer TLS 1.3

  • disable TLS 1.0 and TLS 1.1

  • allow TLS 1.2 only when the enterprise platform requires it and only with approved AEAD ciphers

  • enable HSTS after certificate and host routing are correct

  • avoid response compression for secrets-bearing API responses unless an enterprise review approves it

Atlas itself emits:

  • Strict-Transport-Security: max-age=31536000; includeSubDomains when the request is TLS or has X-Forwarded-Proto: https

  • X-Content-Type-Options: nosniff

  • X-Frame-Options: DENY

  • Referrer-Policy: strict-origin-when-cross-origin

  • Permissions-Policy: geolocation=(), microphone=(), camera=()

  • a restrictive Content Security Policy

The edge may add the same security headers, but do not loosen Atlas headers.

Upstream To Atlas Gateway

The upstream connection from the reverse proxy to the Atlas gateway should use HTTPS. The Atlas gateway server is configured with MinVersion: tls.VersionTLS13 when it terminates TLS.

Required upstream controls:

  • validate the gateway certificate chain

  • set SNI to the gateway certificate name when the proxy supports it

  • keep the upstream network private

  • prefer mTLS for edge-to-gateway traffic in enterprise or classified environments

  • do not use proxy_ssl_verify off outside local development

If a platform owner terminates TLS at the edge and forwards plaintext to a gateway in the same pod or same host namespace, record the exception, the compensating controls, and the exact network boundary. That exception is not the normal enterprise deployment posture.

Atlas sets session and handoff cookies with HttpOnly and SameSite attributes. Cookie Secure is selected from the request scheme:

  • direct TLS request: secure cookie

  • proxied request with X-Forwarded-Proto: https: secure cookie

  • plaintext request without forwarded HTTPS: non-secure cookie

Therefore, a TLS-terminating reverse proxy must set X-Forwarded-Proto: https on public HTTPS requests. If it does not, sign-in, SAML handoff, step-up, trusted-device, and browser SSO flows may fail or appear insecure.

Do not rewrite cookie paths or domains unless the deployment intentionally hosts Atlas below a path prefix. Path-prefix deployments are not the recommended posture; Atlas should normally be served from the root of its own hostname.

WebSocket Behavior

/ws/trust-scores backs the live Trust Scores dashboard experience: the gateway trust WebSocket bridge turns the Redis trust producers into typed envelopes and streams a live trust topology to connected operators. It is gated on api_gateway.websocket_enabled (package default false; the demo stack sets it true). See operations:trust-scores.html for the operator view.

When the live experience is enabled, the reverse proxy must pass /ws/trust-scores as a WebSocket upgrade:

  • configure api_gateway.allowed_origins with the exact HTTPS browser origin

  • forward /ws/ to the gateway

  • use HTTP/1.1 upstream for the WebSocket location

  • preserve Upgrade

  • set Connection: upgrade

  • increase proxy read timeout for long-lived streams

  • preserve Host, Origin, and forwarding headers

When api_gateway.websocket_enabled is false, the route returns not found; the dashboard still renders its REST-seeded trust topology but receives no live updates. Do not expose a separate unauthenticated WebSocket endpoint at the edge.

SAML, OIDC, And WebAuthn Considerations

SAML

When Atlas acts as a SAML IdP, public metadata and SSO URLs must use the external HTTPS Atlas origin. Set:

ATLAS_PUBLIC_BASE_URL=https://atlas.example.mil
ATLAS_SAML_IDP_BASE_URL=https://atlas.example.mil

Verify:

curl -fsS https://atlas.example.mil/api/v1/sso/saml/<app-id>/metadata \
  | grep -E "EntityDescriptor|SingleSignOnService|X509Certificate"

The metadata must not contain internal service names such as api-gateway, Kubernetes service DNS, pod IPs, or localhost.

OIDC App Launch

Atlas builds the OIDC app launch token endpoint from X-Forwarded-Proto and Host unless ATLAS_APP_LAUNCH_TOKEN_ENDPOINT is set. For deterministic deployments, set:

ATLAS_APP_LAUNCH_TOKEN_ENDPOINT=https://atlas.example.mil/api/v1/me/apps/oidc/token

This avoids bad token endpoints when a load balancer rewrites host headers.

WebAuthn

WebAuthn depends on exact browser origins. Set:

ATLAS_BROWSER_BASE_URL=https://atlas.example.mil
ATLAS_PUBLIC_BASE_URL=https://atlas.example.mil

Do not mix http://, internal hostnames, or alternate ports in WebAuthn registration and authentication flows unless those origins are deliberately part of the deployment.

Browser CAC/PIV

Browser CAC/PIV client-certificate authentication uses a dedicated browser-facing listener when enabled:

  • api_gateway.client_certificate_auth.enabled

  • api_gateway.client_certificate_auth.browser_listen_addr

  • api_gateway.client_certificate_auth.browser_base_url

  • api_gateway.client_certificate_auth.trust_bundle_path

If the enterprise reverse proxy terminates client certificates, do not simply forward certificate headers to the normal Atlas listener. Use the dedicated browser CAC listener or a documented mTLS boundary that preserves certificate assurance and prevents header spoofing.

NGINX Reference Configuration

This example serves Atlas at https://atlas.example.mil and forwards to a TLS-enabled Atlas gateway at https://atlas-gateway.internal:8443.

map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}

server {
    listen 80;
    server_name atlas.example.mil;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    server_name atlas.example.mil;

    ssl_certificate     /etc/nginx/tls/atlas.fullchain.pem;
    ssl_certificate_key /etc/nginx/tls/atlas.key;
    ssl_protocols TLSv1.3 TLSv1.2;
    ssl_prefer_server_ciphers off;

    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;

    client_max_body_size 1m;
    proxy_read_timeout 240s;
    proxy_send_timeout 240s;
    proxy_connect_timeout 15s;

    # Remove spoofable client-supplied forwarding and identity headers.
    proxy_set_header Forwarded "";
    proxy_set_header X-Forwarded-For "";
    proxy_set_header X-Forwarded-Host "";
    proxy_set_header X-Forwarded-Port "";
    proxy_set_header X-Forwarded-Proto "";
    proxy_set_header X-Real-IP "";
    proxy_set_header X-Client-Cert "";
    proxy_set_header X-SSL-Client-Cert "";
    proxy_set_header X-Forwarded-Client-Cert "";
    proxy_set_header X-Atlas-User "";
    proxy_set_header X-Atlas-Email "";
    proxy_set_header X-Atlas-Groups "";
    proxy_set_header X-Atlas-Trust-Score "";

    location / {
        proxy_pass https://atlas-gateway.internal:8443;
        proxy_http_version 1.1;

        proxy_ssl_server_name on;
        proxy_ssl_name atlas-gateway.internal;
        proxy_ssl_verify on;
        proxy_ssl_trusted_certificate /etc/nginx/trust/atlas-gateway-ca.pem;

        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Port 443;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Origin $http_origin;
        proxy_set_header Authorization $http_authorization;

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
    }

    location /ws/ {
        proxy_pass https://atlas-gateway.internal:8443;
        proxy_http_version 1.1;
        proxy_read_timeout 86400s;

        proxy_ssl_server_name on;
        proxy_ssl_name atlas-gateway.internal;
        proxy_ssl_verify on;
        proxy_ssl_trusted_certificate /etc/nginx/trust/atlas-gateway-ca.pem;

        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Port 443;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Origin $http_origin;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection upgrade;
    }

    location = /health {
        proxy_pass https://atlas-gateway.internal:8443;
        proxy_ssl_server_name on;
        proxy_ssl_name atlas-gateway.internal;
        proxy_ssl_verify on;
        proxy_ssl_trusted_certificate /etc/nginx/trust/atlas-gateway-ca.pem;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto https;
    }
}
Note

NGINX inheritance rules can be subtle. If you define proxy_set_header inside a location, make sure every required header is set inside that location. Do not rely on global header stripping unless the rendered config proves it applies to all Atlas paths.

Kubernetes Ingress Notes

For Kubernetes, prefer an ingress controller or gateway class that can:

  • terminate public TLS with the enterprise certificate

  • validate HTTPS upstream to the Atlas service

  • strip and reset forwarding headers

  • preserve the external host

  • support WebSocket upgrade

  • set request-body and timeout limits compatible with Atlas

For NGINX Ingress, the annotations normally include:

nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
nginx.ingress.kubernetes.io/proxy-read-timeout: "240"
nginx.ingress.kubernetes.io/proxy-send-timeout: "240"
nginx.ingress.kubernetes.io/proxy-body-size: "1m"

Use controller-specific configuration snippets or policy objects to clear spoofable forwarding and identity headers before setting the trusted values. Keep the rendered ingress manifest as deployment evidence.

Load Balancer And WAF Notes

If the edge is an appliance, cloud load balancer, or WAF:

  • preserve the public Host

  • force X-Forwarded-Proto=https

  • append or set X-Forwarded-For only after removing client-supplied values

  • forward Authorization, Cookie, Origin, and User-Agent

  • allow /api/, /auth/, /graphql, /ws/, /me, /my-apps, /applications, /security, /audit, and static UI routes

  • allow SAML HTTP-POST binding payloads to /api/v1/sso/saml/<app-id>/sso

  • do not inject JavaScript into Atlas pages

  • do not rewrite SAML, OIDC, or WebAuthn callback paths

  • disable response transformations that break CSP, SAML form posts, or WebAuthn

Validation Procedure

Run these checks after configuring the reverse proxy.

  1. Confirm public health.

    curl -fsS https://atlas.example.mil/health
    curl -fsS https://atlas.example.mil/readiness
  2. Confirm HSTS appears on the public endpoint.

    curl -fsSI https://atlas.example.mil/health | grep -i strict-transport-security
  3. Confirm cookies are secure after login.

    curl -k -i https://atlas.example.mil/auth/health | grep -i set-cookie || true

    For an actual login response, Set-Cookie must include HttpOnly; session and SSO cookies on HTTPS should include Secure.

  4. Confirm metadata uses the public host.

    curl -fsS https://atlas.example.mil/api/v1/sso/saml/<app-id>/metadata \
      | grep -E "atlas.example.mil|SingleSignOnService"
  5. Confirm CORS origin is exact.

    curl -i -X OPTIONS https://atlas.example.mil/api/v1/me \
      -H 'Origin: https://atlas.example.mil' \
      -H 'Access-Control-Request-Method: GET' \
      | grep -i access-control-allow-origin
  6. Confirm spoofed forwarded headers are not accepted from the public side.

    curl -fsSI https://atlas.example.mil/health \
      -H 'X-Forwarded-For: 1.2.3.4' \
      -H 'X-Forwarded-Proto: http'

    Then inspect proxy and Atlas logs. The edge should overwrite these values before the request reaches Atlas.

  7. If WebSockets are enabled, confirm the upgrade path with the browser validation suite or an approved WebSocket client. The route is /ws/trust-scores.

Troubleshooting

Symptom Likely cause and fix

Session cookies are missing Secure

The proxy is forwarding plaintext without X-Forwarded-Proto: https, or Atlas is being reached over HTTP in a production-like path. Set X-Forwarded-Proto=https and use HTTPS upstream.

SAML metadata contains localhost, api-gateway, or Kubernetes service DNS

ATLAS_PUBLIC_BASE_URL or ATLAS_SAML_IDP_BASE_URL is missing or wrong. Set it to the public HTTPS origin and restart the gateway.

OIDC app launch token endpoint points to an internal host

The proxy rewrote Host, or ATLAS_APP_LAUNCH_TOKEN_ENDPOINT is unset. Preserve Host or set the endpoint explicitly.

WebAuthn registration fails with origin/RP errors

ATLAS_BROWSER_BASE_URL or ATLAS_PUBLIC_BASE_URL does not match the browser-visible HTTPS origin.

CORS preflight does not include Access-Control-Allow-Origin

api_gateway.allowed_origins does not include the exact browser origin, or the request uses HTTP instead of HTTPS.

Client IP in audit is the proxy address

The direct peer is not recognized as trusted, or the proxy did not set X-Forwarded-For / X-Real-IP. Ensure the proxy is on a private/loopback/link-local upstream path and rewrites forwarding headers.

WebSocket connection fails

The proxy is not using HTTP/1.1 upstream, did not preserve Upgrade, did not set Connection: upgrade, timed out the connection, or api_gateway.websocket_enabled / allowed_origins is not configured.

Browser CAC/PIV login fails behind proxy

Client certificates are being terminated at the wrong listener or converted into spoofable headers. Use the dedicated browser CAC listener and configure browser_base_url, trust bundle, and TLS client certificate handling.

Deployment Evidence Checklist

Record these artifacts for production or enterprise review:

  • public DNS record and owner

  • public TLS certificate chain and expiration

  • upstream gateway certificate chain and validation mode

  • rendered reverse-proxy or ingress configuration

  • list of stripped inbound headers

  • list of headers set for Atlas upstream requests

  • ATLAS_PUBLIC_BASE_URL, ATLAS_SAML_IDP_BASE_URL, ATLAS_BROWSER_BASE_URL, and ATLAS_APP_LAUNCH_TOKEN_ENDPOINT values

  • api_gateway.allowed_origins

  • HSTS validation output

  • SAML metadata public-host validation output

  • WebAuthn registration/authentication validation output when enabled

  • WebSocket validation output when enabled

  • audit sample showing expected client IP and user agent

  • exception record for any plaintext edge-to-gateway hop