Re: if statement and ssl directives (apache 2.4)

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

 



On Wed, Dec 6, 2017 at 4:10 AM, Adam Cecile <acecile@xxxxxxxxxxx> wrote:
> Hi,
>
> I'm trying to achieve a simplier vhost configuration using if statements but
> httpd refuses to start when I put SSL related directive inside the if block:
>
>
> <VirtualHost *:80 *:443>
>   ServerName www.comptoir-hardware.com
>   ServerAlias www.comptoir-hardware.com
>   ServerAlias new.comptoir-hardware.com
>   ServerAlias comptoir.co
>   ServerAlias www.comptoir.co
>
>   <If "req('Port') == '443'">
>     SSLEngine on
>     SSLCertificateFile /etc/ssl/certs/comptoir-hardware.com.crt
>     SSLCertificateKeyFile /etc/ssl/private/comptoir-hardware.com.key
>     SSLCACertificateFile  /etc/ssl/certs/comptoir-hardware.com.ca
>   </If>
>
>   <If "req('Host') != 'www.comptoir-harware.com'">
>     RedirectMatch (.*) http://www.comptoir-hardware.com$1
>   </If>
>
> </VirtualHost>
>

<if> is evaluated per-request. You can't influence the handshake there.

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