Welcome to mirror list, hosted at ThFree Co, Russian Federation.

multi-vhost.conf « sites-available « apache2 « multi_vhosts « debian_apache_2_4 « testdata « tests « certbot_apache « certbot-apache - github.com/certbot/certbot.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5f2b727bf5a2f1485fecc7a2083058814bebde8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<VirtualHost *:80>
    ServerName 1.multi.vhost.tld
    ServerAlias first.multi.vhost.tld
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

<IfModule mod_ssl.c>
    <VirtualHost *:80>
        ServerName 2.multi.vhost.tld
        ServerAlias second.multi.vhost.tld
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ b://u%{REQUEST_URI} [P,NE,L]
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTPS} !^$
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [L,NE,R=permanent]
    </VirtualHost>
</IfModule>

<VirtualHost *:80>
        ServerName 3.multi.vhost.tld
        ServerAlias third.multi.vhost.tld
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteRule "^/secrets/(.+)" "https://new.example.com/docs/$1" [R,L]
RewriteRule "^/docs/(.+)"  "http://new.example.com/docs/$1"  [R,L]
</VirtualHost>