TraceEnable Off
ServerSignature Off
ServerTokens OS

<VirtualHost *:80>
  ServerAdmin me@example.org
  DocumentRoot /var/www/cms/web/

  PassEnv MYSQL_DATABASE
  PassEnv MYSQL_HOST
  PassEnv MYSQL_USER
  PassEnv MYSQL_PORT
  PassEnv MYSQL_PASSWORD
  PassEnv MYSQL_ATTR_SSL_CA
  PassEnv MYSQL_ATTR_SSL_VERIFY_SERVER_CERT
  PassEnv CMS_SERVER_NAME
  PassEnv CMS_DEV_MODE
  PassEnv INSTALL_TYPE
  PassEnv GIT_COMMIT
  PassEnv CMS_USE_MEMCACHED
  PassEnv MEMCACHED_HOST
  PassEnv MEMCACHED_PORT
  PassEnv XMR_HOST

  ServerName ${CMS_SERVER_NAME}

  KeepAlive Off
  LimitRequestBody 0

  XSendFile on
  XSendFilePath /var/www/cms/library

  <Directory /var/www/cms/web/>
      DirectoryIndex index.php index.html
      Options -Indexes +FollowSymLinks -MultiViews
      AllowOverride All
      Require all granted
  </Directory>

  Alias /chromeos /var/www/cms/library/playersoftware/chromeos/latest
  <Directory /var/www/cms/library/playersoftware/chromeos/latest>
      php_admin_value engine Off
      DirectoryIndex index.html
      Options -Indexes -FollowSymLinks -MultiViews
      AllowOverride None
      Require all granted
  </Directory>

  <Location /xmr>
      ProxyPass ws://${XMR_HOST}:8080
  </Location>

  ErrorLog /dev/stderr

  LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" *%Ts* *%Dus*" requesttime

  CustomLog /dev/stdout combined
  CustomLog /dev/stdout requesttime

  # Hardening
  Header always append X-Frame-Options SAMEORIGIN
  Header always append X-Content-Type-Options nosniff

  # Alias /xibo /var/www/cms/web

</VirtualHost>
