IF request_uri regex syntax

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

 



Hello,

Trying to check the request uri against a regex in an IF directive.
This IF directive is located inside a <Location> tag.

Following is the code:

<If "%{REQUEST_URI} =~ /manager/status/ && %{HTTP_USER_AGENT} =~
/Chrome/ && %{QUERY_STRING} =~
/org.apache.catalina.filters.CSRF_NONCE=.*/">

AddOutputFilterByType INFLATE;SUBSTITUTE;DEFLATE text/html

</If>

However, when trying to restart apache, I get the following:

May 16 19:20:53 apache.localdomain systemd[1]: Starting The Apache
HTTP Server...
May 16 19:20:54 apache.localdomain httpd[2586]: AH00526: Syntax error
on line 21 of /etc/httpd/test/test.conf:
May 16 19:20:54 apache.localdomain httpd[2586]: Cannot parse condition
clause: syntax error, unexpected T_ID, expecting $end
May 16 19:20:54 apache.localdomain systemd[1]: httpd.service: main
process exited, code=exited, status=1/FAILURE
May 16 19:20:55 apache.localdomain kill[2588]: kill: cannot find process ""
May 16 19:20:55 apache.localdomain systemd[1]: httpd.service: control
process exited, code=exited status=1
May 16 19:20:55 apache.localdomain systemd[1]: Failed to start The
Apache HTTP Server.
May 16 19:20:55 apache.localdomain systemd[1]: Unit httpd.service
entered failed state.
May 16 19:20:55 apache.localdomain systemd[1]: httpd.service failed.

I can get it to work if I do a string compare (==) but I would like to
do it against a regex statement but just can't seem to figure out the
correct syntax.

Any help is appreciated.

Thank you,

Chaitanya Govande

---------------------------------------------------------------------
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