<VirtualHost 127.0.0.1:443 GERBERA_IP:443>
  ServerName gerbera.DOMAINNAME
  #   SSL Engine Switch:
  #   Enable/Disable SSL for this virtual host.
  SSLEngine on

  #   You can use per vhost certificates if SNI is supported.
  SSLCertificateFile /etc/ssl/servercerts/servercert.pem
  SSLCertificateKeyFile /etc/ssl/servercerts/serverkey.pem
  SSLProxyEngine on
  SSLProxyVerify none
  SSLProxyCheckPeerExpire off
#  SSLProxyCheckProxyCheckPeerNaPeerCN off
#  SSLme off

  ProxyRequests Off
  ProxyVia Full
  ProxyPreserveHost off

# Protocols h2 http/1.1
  RequestHeader set X-Forwarded-Proto "https"

  RewriteEngine on
  AllowEncodedSlashes on

  <Proxy *>
    Require all granted
  </Proxy>

  <Location />
    Header edit Location ^http:://GERBERA_IP:GERBERA_PORT/ https:://gerbera.DOMAINNAME/
    Header edit Destination ^https:://gerbera.DOMAINNAME/ http:://GERBERA_IP:GERBERA_PORT/
    RequestHeader edit Location ^http:://GERBERA_IP:GERBERA_PORT/ https:://gerbera.DOMAINNAME/
    RequestHeader edit Destination ^https:://gerbera.DOMAINNAME/ http:://GERBERA_IP:GERBERA_PORT/
    ProxyPass "http://GERBERA_IP:GERBERA_PORT/"
    ProxyPassReverse "http://GERBERA_IP:GERBERA_PORT/"
  </Location>

  <Directory />
    AllowOverride None
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>
