From 6abec16a31801a197a0f57328bc33a211b793698 Mon Sep 17 00:00:00 2001
From: Jan Grewe <jan@faked.org>
Date: Mon, 25 Jan 2016 21:40:26 +0100
Subject: [PATCH] add vHost config to show header magic

---
 examples/vhost.conf | 53 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 examples/vhost.conf

diff --git a/examples/vhost.conf b/examples/vhost.conf
new file mode 100644
index 0000000..e9ff7ac
--- /dev/null
+++ b/examples/vhost.conf
@@ -0,0 +1,53 @@
+<VirtualHost *:81>
+  ServerAdmin info@example.com
+  ServerName cdn.example.com
+  ServerAlias cdn*.example.com
+
+  # Let Photon know if the request came via HTTPS (see below)
+  SetEnvIf X-Forwarded-Proto https HTTPS=on
+
+  DocumentRoot /srv/www/cdn.example.com
+
+  <Directory /srv/www/cdn.example.com/>
+    Options Indexes FollowSymLinks MultiViews
+    AllowOverride all
+    Order allow,deny
+    allow from all
+  </Directory>
+
+  ErrorLog ${APACHE_LOG_DIR}/error.log
+  LogLevel warn
+  CustomLog ${APACHE_LOG_DIR}/cdn-access.log combined
+</VirtualHost>
+
+<IfModule mod_ssl.c>
+<VirtualHost *:443>
+  ServerAdmin info@example.com
+  ServerName cdn.example.com
+  ServerAlias cdn*.example.com
+
+  # Tell Varnish to let Photon know that the request came in via HTTPS (see above)
+  RequestHeader set X-Forwarded-Proto https
+
+  ProxyPreserveHost On
+  ProxyPass / http://127.0.01:80/
+  ProxyPassReverse / http://127.0.0.1:80/
+
+  ErrorLog ${APACHE_LOG_DIR}/error.log
+  LogLevel warn
+  CustomLog ${APACHE_LOG_DIR}/cdn-access.log combined
+
+  SSLEngine on
+  SSLCertificateFile    /etc/ssl/local/wildcard.example.com.crt
+  SSLCertificateKeyFile /etc/ssl/private/wildcard.example.com.key
+
+  #SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt
+  SSLCACertificatePath /etc/ssl/certs/
+  SSLCACertificateFile /etc/ssl/certs/ca-certificates.crt
+
+  <FilesMatch "\.(cgi|shtml|phtml|php)$">
+    SSLOptions +StdEnvVars
+  </FilesMatch>
+
+</VirtualHost>
+</IfModule>
-- 
GitLab