I have the following conf. I am trying to set a cookie with a value which I extracted in the rewrite rule. But the value of the cookie being always set to null. Is it a problem with the regex or I am trying to do something wrong here. I am completely new to apache httpd.
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(.*)uname=(.*)
RewriteRule ^/(.*)&uname=(.*)$ /$1 [env=GRAFANA_UNAME:%2,L,PT]
RewriteCond %{HTTP_COOKIE} uname=(.*)
RewriteRule ^(.*)$ "-" [env=GRAFANA_UNAME:%1,L,PT]
RequestHeader set X-WEBAUTH-USER %{GRAFANA_UNAME}e
RequestHeader unset Authorization
ProxyRequests Off
ProxyPass "/" http://localhost:3000/
ProxyPassReverse "/" http://localhost:3000/
Header always set Set-Cookie "uname=%{GRAFANA_UNAME}e;path=/;HttpOnly"
When I do uname=%{GRAFANA_UNAME}e the cookie value is being set to null always. How do I get the value of uname in the response header.