<VirtualHost *:8080>
  DocumentRoot /var/www/html/clicqui.net
  ServerName clic.localhost
  ServerAlias clic.internal
      
  ErrorLog /var/log/apache2/clic.localhost-error.log
	CustomLog /var/log/apache2/clic.localhost-access.log combined
  #LogLevel alert rewrite:trace8

  RewriteEngine On

  RewriteRule . - [E=X_ADA_PRODTYPE:landing]
  RewriteRule . - [E=X_ADA_HTTP_HOST:clic.localhost]

  Header always set Access-Control-Allow-Origin "*"
  Header always set Access-Control-Allow-Credential "true"
  Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
  Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"
  #Header always set X-Frame-Options "*"
  Header set Cache-Control "max-age=84600, public"

  Alias /img /var/www/html/smssmart/img
  Alias /js /var/www/html/smssmart/js
  Alias /css /var/www/html/smssmart/css
  
  <Directory /var/www/html/clicqui.net>
      Options -Indexes +FollowSymLinks +MultiViews
      AllowOverride All
      Require all granted
  </Directory>
  <FilesMatch \.php$>
      # Apache 2.4.10+ can proxy to unix socket
      SetHandler "proxy:unix:/var/run/php/php5.6-fpm.sock|fcgi://localhost/"
  </FilesMatch>
</VirtualHost>
<VirtualHost *:443>
  DocumentRoot /var/www/html/clicqui.net
  ServerName clic.localhost
  ServerAlias clic.internal
      
  SSLEngine on

  SSLCertificateFile      /etc/ssl/certs/localhost.crt
  SSLCertificateKeyFile /etc/ssl/private/localhost.key
  #LogLevel trace5
  ErrorLog /var/log/apache2/clic.localhost-ssl-error.log
  CustomLog /var/log/apache2/clic.localhost-ssl-access.log combined

  ProxyPreserveHost On
  ProxyPass / http://127.0.0.1:80/
  RequestHeader set X-Forwarded-Port "443"
  RequestHeader set X-Forwarded-Proto "https"
</VirtualHost>
