# Allow read in the public directories.
<Directory "C:/graphictoria/COMMIT_HASH/web/public/">
	Require all granted
	AllowOverride All
</Directory>
<Directory "C:/graphictoria/COMMIT_HASH/web/public_api/">
	Require all granted
	AllowOverride All
</Directory>

# Disallow access to admin JS
<Directory "C:/graphictoria/COMMIT_HASH/web/public/js/adm/">
	Require all denied
	AllowOverride All
</Directory>

# Defaults for the proceding virtualhosts on *.gtoria.net
<VirtualHost *:80 *:443>
	ServerAdmin admin@gtoria.net
	ServerName gtoria.net
	
	ServerAlias www.gtoria.net
	
	SSLEngine on
	SSLCertificateFile "C:/graphictoria/COMMIT_HASH/etc/cert/cloudflare.crt"
    SSLCertificateKeyFile "C:/graphictoria/COMMIT_HASH/etc/cert/cloudflare.key"
	
	ErrorLog "C:/graphictoria/logs/gt-error.log"
	LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Host}i\" \"%{Referer}i\" \"%{User-agent}i\"" gtoria
	CustomLog "C:/graphictoria/logs/gt-access.log" gtoria
	
	RewriteEngine On
	RewriteCond %{HTTP_HOST} !^www\. [NC]
	RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
	
	RewriteCond %{HTTPS} off
	RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}
	
	DocumentRoot "C:/graphictoria/COMMIT_HASH/web/public"
</VirtualHost>

# Blog/Wiki
<VirtualHost *:80 *:443>
	ServerName gtoria.net
	
	ServerAlias blog.gtoria.net
	ServerAlias wiki.gtoria.net
	
	SSLEngine on
	SSLCertificateFile "C:/graphictoria/COMMIT_HASH/etc/cert/cloudflare.crt"
    SSLCertificateKeyFile "C:/graphictoria/COMMIT_HASH/etc/cert/cloudflare.key"

	ErrorLog "C:/xampp/logs/gt-error.log"
	LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Host}i\" \"%{Referer}i\" \"%{User-agent}i\"" gtoria
	CustomLog "C:/xampp/logs/gt-access.log" gtoria
	
	RewriteCond %{HTTPS} off
	RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}
	
	DocumentRoot "C:/graphictoria/COMMIT_HASH/web/public"
</VirtualHost>

# Api endpoints.
<VirtualHost *:80 *:443>
	ServerName gtoria.net
	
	ServerAlias api.gtoria.net
	ServerAlias apis.gtoria.net
	ServerAlias assetgame.gtoria.net
	ServerAlias cdn.gtoria.net
	ServerAlias clientsettings.api.gtoria.net
	ServerAlias data.gtoria.net
	ServerAlias ecsv2.gtoria.net
	ServerAlias ephemeralcounters.api.gtoria.net
	ServerAlias gamepersistence.gtoria.net
	ServerAlias logging.service.gtoria.net
	ServerAlias setup.gtoria.net
	ServerAlias test.public.ecs.gtoria.net
	ServerAlias versioncompatibility.api.gtoria.net
	
	SSLEngine on
	SSLCertificateFile "C:/graphictoria/COMMIT_HASH/etc/cert/cloudflare.crt"
    SSLCertificateKeyFile "C:/graphictoria/COMMIT_HASH/etc/cert/cloudflare.key"
	
	ErrorLog "C:/graphictoria/logs/gt-error.log"
	LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Host}i\" \"%{Referer}i\" \"%{User-agent}i\"" gtoria
	CustomLog "C:/graphictoria/logs/gt-access.log" gtoria
	
	DocumentRoot "C:/graphictoria/COMMIT_HASH/web/public_api"
</VirtualHost>