diff --git a/templates/etc-apache2-sites-available-sd-agent b/templates/etc-apache2-sites-available-sd-agent
index 2a90228aa3f5fb24f5cc6ad6eb47fdee5ad54d18..0bd5dc15e803f5938c736603267fa19d2a08fecd 100644
--- a/templates/etc-apache2-sites-available-sd-agent
+++ b/templates/etc-apache2-sites-available-sd-agent
@@ -1,10 +1,17 @@
 <VirtualHost *:80>
-    <Location /server-status>
-        SetHandler server-status
-        Order Deny,Allow
-        Deny from all
-        Allow from 127.0.0.1{% for address in ansible_all_ipv4_addresses %} {{ address }}{% endfor %}
+  ServerName {{ inventory_hostname }}
+  <Location /server-status>
+    SetHandler server-status
+    Order Deny,Allow
+    Deny from all
+    Allow from 127.0.0.1{% for address in ansible_all_ipv4_addresses %} {{ address }}{% endfor %}
 
-    </Location>
-    ServerName {{ inventory_hostname }}
+  </Location>
+
+  ErrorLog ${APACHE_LOG_DIR}/error.log
+  LogLevel warn
+  LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy
+  SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
+  CustomLog ${APACHE_LOG_DIR}/access.log combined env=!forwarded
+  CustomLog ${APACHE_LOG_DIR}/access.log proxy env=forwarded
 </VirtualHost>