Nginx upstream health check - custom header

Like every other use of proxy_pass nginx defaults to making an HTTP/1.0 connection to the upstream with the Host header set to the defined name of the upstream or its IP address.

You can set a Host header or HTTP/1.1 (or both) yourself to override these.

    location /health {
        health_check;
        proxy_pass http://backend;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
    }