You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by tom <po...@post.cz> on 2007/08/01 14:38:08 UTC
[users@httpd] ignore/remove X-Forwarded-For
Hi,
is there a way to remove the X-Forwarded-For header from the request before it enters some point in the request route through apache? I need this because the weblogic module honors the header and this is not what is needed by us.
Thanks for your responses
Tomas
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] ignore/remove X-Forwarded-For
Posted by tom <po...@post.cz>.
That would be the best way, but don't know how to do that in httpd.conf...
> > > ----------------------------------------
> > > On 8/2/07, tom <po...@post.cz> wrote:
> > > > Hi,
> > > >
> > > > thanks, works fine. Do you know if I can rename a header? I was trying to
> do
> > > it like this
> > > >
> > > > SetEnvIf X-Powered-By "(.*)" HAVE_X-Powered-By=$1
> > > > Header add X-Original-Powered-By $HAVE_X-Powered-By$
> env=HAVE_X-Powered-By
> > > > Header unset X-Powered-By env=HAVE_X-Powered-By
> > > >
> > > > The problem is that I don't know how to access the HAVE_X-Powered-By
> variable
> > > at the second line ($HAVE_X-Powered-By$).
> > > >
> > >
> > > Use %{HAVE_X-Powered-By}e
> > > See:
> > > http://httpd.apache.org/docs/2.2/mod/mod_headers.html#header
> > >
> > > Joshua.
> > >
>
> Hold on, couldnt you just do a=b; unset a? or am i reading this wrong
> (i need to look for a specific header too, but i get so many variants
> of it i'd bloat the code checking for all variants of it in my PHP)
>
>
> --
> Morgan gangwere
>
> "Space does not reflect society, it expresses it." -- Castells, M.,
> Space of Flows, Space of Places: Materials for a Theory of Urbanism in
> the Information Age, in The Cybercities Reader, S. Graham, Editor.
> 2004, Routledge: London. p. 82-93.
> -----BEGIN PGP SIGNATURE-----
> Version: Gmail/GnuPG Min32 Hack
> Comment: Using GnuPG and Gmail - ask me about Grim Fandango
>
> iD8DBQFGV3KQCF9T/dUsmAgRAvESAKDfZYbRtebNO+WPfx6DryIvIwt9TgCgukZG
> cIj5nSWws/pAeW2ESlj7GuM=
> =Y4uC
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
>
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] ignore/remove X-Forwarded-For
Posted by Morgan Gangwere <0....@gmail.com>.
On 8/2/07, tom <po...@post.cz> wrote:
> Many thanks again !!
> One last think, how do I match the whole string with (.*) I match nothing.. I tried some things like (.*+) and (.+) but none of them seems to work.
>
> Thanks
> Tomas
> > ----------------------------------------
> > On 8/2/07, tom <po...@post.cz> wrote:
> > > Hi,
> > >
> > > thanks, works fine. Do you know if I can rename a header? I was trying to do
> > it like this
> > >
> > > SetEnvIf X-Powered-By "(.*)" HAVE_X-Powered-By=$1
> > > Header add X-Original-Powered-By $HAVE_X-Powered-By$ env=HAVE_X-Powered-By
> > > Header unset X-Powered-By env=HAVE_X-Powered-By
> > >
> > > The problem is that I don't know how to access the HAVE_X-Powered-By variable
> > at the second line ($HAVE_X-Powered-By$).
> > >
> >
> > Use %{HAVE_X-Powered-By}e
> > See:
> > http://httpd.apache.org/docs/2.2/mod/mod_headers.html#header
> >
> > Joshua.
> >
Hold on, couldnt you just do a=b; unset a? or am i reading this wrong
(i need to look for a specific header too, but i get so many variants
of it i'd bloat the code checking for all variants of it in my PHP)
--
Morgan gangwere
"Space does not reflect society, it expresses it." -- Castells, M.,
Space of Flows, Space of Places: Materials for a Theory of Urbanism in
the Information Age, in The Cybercities Reader, S. Graham, Editor.
2004, Routledge: London. p. 82-93.
-----BEGIN PGP SIGNATURE-----
Version: Gmail/GnuPG Min32 Hack
Comment: Using GnuPG and Gmail - ask me about Grim Fandango
iD8DBQFGV3KQCF9T/dUsmAgRAvESAKDfZYbRtebNO+WPfx6DryIvIwt9TgCgukZG
cIj5nSWws/pAeW2ESlj7GuM=
=Y4uC
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] ignore/remove X-Forwarded-For
Posted by tom <po...@post.cz>.
Many thanks again !!
One last think, how do I match the whole string with (.*) I match nothing.. I tried some things like (.*+) and (.+) but none of them seems to work.
Thanks
Tomas
> ----------------------------------------
> On 8/2/07, tom <po...@post.cz> wrote:
> > Hi,
> >
> > thanks, works fine. Do you know if I can rename a header? I was trying to do
> it like this
> >
> > SetEnvIf X-Powered-By "(.*)" HAVE_X-Powered-By=$1
> > Header add X-Original-Powered-By $HAVE_X-Powered-By$ env=HAVE_X-Powered-By
> > Header unset X-Powered-By env=HAVE_X-Powered-By
> >
> > The problem is that I don't know how to access the HAVE_X-Powered-By variable
> at the second line ($HAVE_X-Powered-By$).
> >
>
> Use %{HAVE_X-Powered-By}e
> See:
> http://httpd.apache.org/docs/2.2/mod/mod_headers.html#header
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
>
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] ignore/remove X-Forwarded-For
Posted by Joshua Slive <jo...@slive.ca>.
On 8/2/07, tom <po...@post.cz> wrote:
> Hi,
>
> thanks, works fine. Do you know if I can rename a header? I was trying to do it like this
>
> SetEnvIf X-Powered-By "(.*)" HAVE_X-Powered-By=$1
> Header add X-Original-Powered-By $HAVE_X-Powered-By$ env=HAVE_X-Powered-By
> Header unset X-Powered-By env=HAVE_X-Powered-By
>
> The problem is that I don't know how to access the HAVE_X-Powered-By variable at the second line ($HAVE_X-Powered-By$).
>
Use %{HAVE_X-Powered-By}e
See:
http://httpd.apache.org/docs/2.2/mod/mod_headers.html#header
Joshua.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] ignore/remove X-Forwarded-For
Posted by tom <po...@post.cz>.
Hi,
thanks, works fine. Do you know if I can rename a header? I was trying to do it like this
SetEnvIf X-Powered-By "(.*)" HAVE_X-Powered-By=$1
Header add X-Original-Powered-By $HAVE_X-Powered-By$ env=HAVE_X-Powered-By
Header unset X-Powered-By env=HAVE_X-Powered-By
The problem is that I don't know how to access the HAVE_X-Powered-By variable at the second line ($HAVE_X-Powered-By$).
Thanks in advance,
Tomas
> On 8/1/07, tom <po...@post.cz> wrote:
> > Hi,
> >
> > is there a way to remove the X-Forwarded-For header from the request before
> it enters some point in the request route through apache? I need this because
> the weblogic module honors the header and this is not what is needed by us.
> >
>
> You can try
> RequestHeader unset X-Forwarded-For
> I have no idea whether that will work or not.
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
>
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] ignore/remove X-Forwarded-For
Posted by Joshua Slive <jo...@slive.ca>.
On 8/1/07, tom <po...@post.cz> wrote:
> Hi,
>
> is there a way to remove the X-Forwarded-For header from the request before it enters some point in the request route through apache? I need this because the weblogic module honors the header and this is not what is needed by us.
>
You can try
RequestHeader unset X-Forwarded-For
I have no idea whether that will work or not.
Joshua.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org