title: nginx read response header when multiple headers have the same name
body: <p>I want to read the following response headers.</p>
  <p>Response-Header:</p>
  <pre><code>...
  set-cookie: somecookie=7ABFBB3446C856779B59A837DE3946F7DB; Path=/; Secure;
  set-cookie: wantedcookie=12414ASDFAFADFW2342342; Path=/; Secure;
  ...
  </code></pre>
  <p>The variable <code>$sent_http_set_cookie</code> contains the first header</p>
  <p><code>$sent_http_set_cookie = somecookie=7ABFBB3446C856779B59A837DE3946F7DB; Path=/; Secure;</code></p>
  <p>--</p>
  <p>How to read the second header in order to get the value of the <code>wantedcookie</code>?</p>
  <p>The nginx configuration looks like this:</p>
  <pre><code>location /api {
    add_header X-Debug &quot;${sent_http_set_cookie}&quot;;
  }
  </code></pre>