Hi.

I’m using HA-Proxy 1.5.14.

I’ve got configuration like this:

listen heatonra 0.0.0.0:7777
  server cargo localhost:8080
  acl ORIGIN_PRESENT req.hdr(Origin) -m found
  http-response set-header Hello World         if ORIGIN_PRESENT
  http-response set-header Access-Control-Allow-Origin %[req.hdr(Origin)]

But when I send a request with the “Origin” header, the use of
“req.hdr(Origin)” doesn’t seem to work:

$ curl -X HEAD -v -H "Origin: myself"
http://localhost:7777/platform/collections/tree
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 7777 (#0)
> HEAD /platform/collections/tree HTTP/1.1
> Host: localhost:7777
> User-Agent: curl/7.43.0
> Accept: */*
> Origin: myself
>
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< Content-Location: /platform/collections/tree
< Cache-Control: no-transform, max-age=604800
< X-PROCESSING-TIME: 1
< Content-Type: application/xml
< Content-Length: 0
< Date: Tue, 02 Feb 2016 18:55:44 GMT
< Access-Control-Allow-Origin:
<
* Connection #0 to host localhost left intact

I’m expecting “Hello: World” and “Access-Control-Allow-Origin: myself” in
the response.

Can anyone explain where my expectations are incorrect or why I’m not
seeing what I’m expecting?

Thanks!

-Ryan
​

Reply via email to