[TriLUG] Working with headers in apache

Steve Hoffman srhoffman at gmail.com
Fri Nov 7 17:18:58 EST 2008


These are all great suggestions...but for some reason none were working...I
tried all different permutations with no luck...so I decided to fire up
wireshark and found that there may not be a way to do this without app
development.  Turns out the headers from the client don't include the
"userType" header...that is injected at the reverse proxy so unless
mod_rewrite can catch the proxied request (request from the proxy to the
downstream server) it's back to the drawing board for me...

If anyone has any other thoughts, I'm all ears!

Thanks,
Steve

On Fri, Nov 7, 2008 at 11:42 AM, Marc Wiatrowski <mwia at iglass.net> wrote:

> On Thu, 2008-11-06 at 21:56 -0500, Steve Hoffman wrote:
> > Hello all,
> > I have a question that hopefully someone here can help with...a web user
> is
> > redirected from a third party site with a few headers set by that third
> > party, the most important of which is userType.  what I would like to do
> is
> > (with apache working as a reverse proxy) inspect the headers as they pass
> > through and if userType=S && sourceIP!=10.0.0.0/24 throw a custom error
> > page.
> >
>
> What about something like this? (not tested at all)
>
> RewriteEngine On
> RewriteCond %{HTTP:userType} ^S$
> RewriteCond %{REMOTE_ADDR} !^10\.0\.0\.
> RewriteRule ^/.*  /error.html  [L]
>
> marc
>
>
> --
>  TriLUG mailing list        :
> http://www.trilug.org/mailman/listinfo/trilug
> TriLUG FAQ  : http://www.trilug.org/wiki/Frequently_Asked_Questions
>



More information about the TriLUG mailing list