# Example nginx snippet for GameCloud WHMCS integration mTLS
# Place inside the server {} block that proxies to the API upstream.

ssl_client_certificate /etc/ssl/gamecloud/integration-ca.crt;
ssl_verify_client optional;

location /api/v1/integrations/whmcs/ {
    proxy_pass http://gamecloud_api;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;

    # OpenSSL 1.1.1+ / nginx 1.15.3+
    proxy_set_header X-HGC-Client-Cert-Fingerprint $ssl_client_fingerprint;
    proxy_set_header X-HGC-Client-Cert-Subject $ssl_client_s_dn;
}
