forked from serversideup/docker-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathssl-full.conf
More file actions
33 lines (25 loc) · 1.04 KB
/
ssl-full.conf
File metadata and controls
33 lines (25 loc) · 1.04 KB
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
<VirtualHost *:${APACHE_HTTP_PORT}>
# Configure ServerAdmin and ServerName
ServerName localhost
ServerAdmin webmaster@localhost
# Set Real IP header
RemoteIPHeader ${APACHE_REMOTE_IP_HEADER}
# Turn on rewrite engine
RewriteEngine On
# Redirect traffic from localhost to https://localhost:${APACHE_HTTPS_PORT}
RewriteCond %{SERVER_NAME} =localhost
RewriteRule ^ https://%{SERVER_NAME}:${APACHE_HTTPS_PORT}%{REQUEST_URI} [END,NE,R=permanent]
# Redirect all other traffic to https://host:443
RewriteCond %{SERVER_NAME} !=localhost
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
# Set environment variable for healthcheck requests
SetEnvIf Request_URI "^${HEALTHCHECK_PATH}$" dontlog
# Configure Log Settings
LogFormat "%l %u %t %v %a \"%r\" %>s %b" comonvhost
ErrorLog /dev/stderr
CustomLog /dev/stdout comonvhost env=!dontlog
LogLevel ${LOG_OUTPUT_LEVEL}
</VirtualHost>
<VirtualHost *:${APACHE_HTTPS_PORT}>
Include /etc/apache2/vhost-templates/https.conf
</VirtualHost>