Apache+fcgi how to get header's value in Apache config

35 views Asked by At

i have fcgi server, there is a script:

#!/usr/bin/perl
use FCGI;
my $request = FCGI::Request();
while ($request->Accept() >= 0) {
    die if $ENV{'FCGI_APACHE_ROLE'} ne "AUTHORIZER";
    die if $ENV{'FCGI_ROLE'}        ne "AUTHORIZER";
    die if $ENV{'REMOTE_PASSWD'};

    print STDERR "This text is written to the web server error log.\n";

    if ($ENV{'REMOTE_USER'} eq "foo1") {
        print "Status: 200\n";
        print "Variable-AUTHZ_1: authz_01\n";
        print "Variable-AUTHZ_2: authz_02\n";
        print "\n";
    }
    else {
        print "Status: 403\n\n";
    }
}

And i want to get value of Variable-AUTHZ_1 header and set it in ENV variable in apache config like this

SetEnv X_AECA_USER_ID Variable-AUTHZ_1,

where Variable-AUTHZ_1 is the value returned from fcgi script.

How can i do it? is it possible?

I tried using RewriteCond but it did't work

0

There are 0 answers