Quantcast
Channel: Active questions tagged header - Stack Overflow
Viewing all articles
Browse latest Browse all 646

Why does the header conditional statement work in Apache?

$
0
0

When you take a custom log in the httpd.conf file, DEPT and conditions match.However, the value that is set in the actual ROLE is Viewer. If anyone knows why, please let me know

`<VirtualHost *:80>ServerName localhost

ProxyRequests OffProxyPass / http://localhost:3000/ProxyPassReverse / http://localhost:3000/<If "'${HTTP:DEPT}' == 'Engineering'">    RequestHeader set ROLE "Admin"</If><Else>    RequestHeader set ROLE "Viewer"</Else>LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{ROLE}i\" \"%{DEPT}i\" " combinedssouserCustomLog logs/access_log combinedssouser

`

"POST /api/ds/query?ds_type=prometheus&requestId=Q100 HTTP/1.1" 200 5189 "https://localshot:3000/d/xxxxxxxxxxxxx/new-dashboard?orgId=1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" "Viewer" "Engineering"

I would like to have ADMIN set as the header with ROLE if the DEPT value in the header matches the string.


Viewing all articles
Browse latest Browse all 646

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>