<VirtualHost *:443>

  #Lets encrypt challenge path
  Alias "/.well-known/" "/mnt/LEChallenge/.well-known/"
  ProxyPass /.well-known !

  ServerAdmin <%= server_admin %>
  ServerName <%= server_name %>
  ProxyRequests off

  <Proxy />
  Order deny,allow
  Allow from all
  </Proxy>

  # Ressources publiques
  alias /resources /home/http-smartpanda/resources/<%= ecosys_name %>/
  ProxyPassMatch ^/resources !

  # Robot.txt
  alias /robots.txt /home/http-smartpanda/sp-robots-disallow.txt
  ProxyPass /robots.txt !

  # PandaWeb
  alias /sites /home/http-smartpanda/sites/
  # Preview
  ProxyPassMatch /sites/00_boxsites/preview/.+ !
  # Prod
  ProxyPassMatch /sites/[^!00_boxsites] !

  <Directory /home/http-smartpanda/sites/>
  Options +FollowSymLinks
  AllowOverride All
  </Directory>

  #SiteMap
  <Location "/sitemap.xml">
  ProxyPass http://127.0.0.1:8080/sp-back/public/staticPage/sitemap/
  </Location>
  <Location "/sitemap">
  ProxyPass http://127.0.0.1:8080/sp-back/public/staticPage/sitemap
  </Location>


  # Home
  ProxyPass /  http://127.0.0.1:7777/
  ProxyPassReverse / http://127.0.0.1:7777/
  RequestHeader set ecosys "<%= ecosys_name %>"

  # Log
  ErrorLog ${APACHE_LOG_DIR}/error-new235-ssl-eco6-tech.log
  LogLevel error
  CustomLog ${APACHE_LOG_DIR}/ssl_access-new235.eco6.tech.log combined

  #   SSL Engine Switch:
  #   Enable/Disable SSL for this virtual host.
  SSLEngine on
  SSLProtocol all -SSLv2
  SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM

  SSLCertificateFile /etc/letsencrypt/live/<%= server_name %>/fullchain.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/<%= server_name %>/privkey.pem


</VirtualHost>
