Re: Remote_Port not recognized by SetEnvIf?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2017-11-23 14:07 GMT+03:00 Daniel <dferradal@xxxxxxxxx>:
> Hello,
>
> I'm trying to make a test using the REMOTE_PORT variable introduced in
> 2.4.26 according to the docs:
> http://httpd.apache.org/docs/2.4/expr.html#vars
>
> Problem I find is I can set this up easily with mod_rewrite.
>
> "
> RewriteEngine on
> RewriteRule .* - [E=REMOTE_PORT:%{REMOTE_PORT},NE]
> Header set RPHdrname %{REMOTE_PORT}e
> "
>
> But SetEnvIf does not recognize Remote_Port.
> Docs do not say it supports it, but since it is recent, I had hoped
> docs were not updated since 2.4.26 or similar.
>
> Tested this, perhaps incorrectly or in a too convoluted way, I will
> appreciate your feedback:
>
> "
> SetEnvIf Remote_Port (.*) REMOTE_PORT=$1
> Header set RPHdrname "%{REMOTE_PORT:}e
> "
>
> RPHdrname comes out empty this way ^^^

Maybe try SetEnvIfExpr directive instead of SetEnvIf?

http://httpd.apache.org/docs/2.4/mod/mod_setenvif.html#setenvifexpr

The Bugzilla ticket that introduced the REMOTE_PORT support in 2.4.26:
https://bz.apache.org/bugzilla/show_bug.cgi?id=59938

Looking at the changes, only expr parser was patched.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux