Skip to content

Commit b31dc2b

Browse files
authored
Merge pull request #24 from devilbox/release-0.29
Add Via Header
2 parents 8a93a41 + b83cd24 commit b31dc2b

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

Dockerfile

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ LABEL \
77
vendor="devilbox" \
88
license="MIT"
99

10+
1011
###
1112
### Build arguments
1213
###
@@ -34,10 +35,8 @@ ENV HTTPD_RELOAD="/usr/local/apache2/bin/httpd -k stop"
3435

3536

3637
###
37-
### Installation
38+
### Install required packages
3839
###
39-
40-
# required packages
4140
RUN set -x \
4241
&& apt-get update \
4342
&& apt-get install --no-install-recommends --no-install-suggests -y \
@@ -67,8 +66,12 @@ RUN set -x \
6766
${BUILD_DEPS} \
6867
&& rm -rf /var/lib/apt/lists/*
6968

70-
# Add custom config directive to httpd server
69+
70+
###
71+
### Configure Apache
72+
###
7173
RUN set -x \
74+
&& APACHE_VERSION="$( httpd -V | grep -Eo 'Apache/[.0-9]+' | awk -F'/' '{print $2}' )" \
7275
&& ( \
7376
echo "ServerName localhost"; \
7477
\
@@ -96,10 +99,23 @@ RUN set -x \
9699
echo "SSLSessionCache \"shmcb:/usr/local/apache2/logs/ssl_scache(512000)\""; \
97100
echo "SSLSessionCacheTimeout 300"; \
98101
\
102+
echo "<If \"%{THE_REQUEST} =~ m#^.*HTTP/1\.0\$#\">"; \
103+
echo " Header always set Via \"1.0 %{HOSTNAME}e (apache/${APACHE_VERSION})\""; \
104+
echo "</If>"; \
105+
echo "<If \"%{THE_REQUEST} =~ m#^.*HTTP/1\.1\$#\">"; \
106+
echo " Header always set Via \"1.1 %{HOSTNAME}e (apache/${APACHE_VERSION})\""; \
107+
echo "</If>"; \
108+
echo "<If \"%{THE_REQUEST} =~ m#^.*HTTP/2\.0\$#\">"; \
109+
echo " Header always set Via \"2.0 %{HOSTNAME}e (apache/${APACHE_VERSION})\""; \
110+
echo "</If>"; \
111+
\
99112
echo "HTTPProtocolOptions unsafe"; \
100113
) >> /usr/local/apache2/conf/httpd.conf
101114

102-
# create directories
115+
116+
###
117+
### Create directories
118+
###
103119
RUN set -x \
104120
&& mkdir -p /etc/httpd-custom.d \
105121
&& mkdir -p /etc/httpd/conf.d \

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,13 @@ $ docker run -d \
246246

247247
#### 4. Ultimate pre-configured docker-compose setup
248248

249-
Have a look at the **[devilbox](https://github.com/cytopia/devilbox)** for a fully-customizable docker-compose variant.
249+
Have a look at the **[Devilbox](https://github.com/cytopia/devilbox)** for a fully-customizable docker-compose variant.
250250

251251
It offers pre-configured mass virtual hosts and an intranet.
252252

253253
It allows any of the following combinations:
254254

255-
* PHP 5.2, 5.3, 5.4, PHP 5.5, PHP 5.6, PHP 7.0, PHP 7.1, 7.2, 7.3 and 7.4
255+
* PHP 5.2, PHP 5.3, PHP 5.4, PHP 5.5, PHP 5.6, PHP 7.0, PHP 7.1, PHP 7.2, PHP 7.3, PHP 7.4 and PHP 8.0
256256
* MySQL 5.5, MySQL 5.6, MySQL 5.7, MariaDB 5 and MariaDB 10
257257
* Apache 2.2, Apache 2.4, Nginx stable and Nginx mainline
258258
* And more to come...
@@ -261,8 +261,8 @@ It allows any of the following combinations:
261261
## Version
262262

263263
```
264-
Server version: Apache/2.4.37 (Unix)
265-
Server built: Dec 29 2018 02:11:11
264+
Server version: Apache/2.4.38 (Unix)
265+
Server built: Feb 12 2019 21:20:23
266266
Server's Module Magic Number: 20120211:83
267267
Server loaded: APR 1.5.2, APR-UTIL 1.5.4
268268
Compiled using: APR 1.5.2, APR-UTIL 1.5.4

0 commit comments

Comments
 (0)