<IfModule mod_mime.c>
	AddType text/x-yaml .yml
</IfModule>

<IfModule mpm_prefork_module>
	ServerLimit 30
	MaxRequestWorkers 30
	MaxRequestsPerChild 1000
</IfModule>

<VirtualHost *:80>
	DocumentRoot /usr/share/hedera-web/spa

	RewriteEngine On
	RewriteCond %{QUERY_STRING} (^|&)srv=([^&]+) [OR]
	RewriteCond %{REQUEST_METHOD} POST
	RewriteRule ^/$ /usr/share/hedera-web/back/index.php [L]
</VirtualHost>

<Directory /usr/share/hedera-web/back>
	Options -Indexes -FollowSymLinks
	AllowOverride None
	Require all granted

	SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
</Directory>

<Directory /usr/share/hedera-web/spa>
	Options -FollowSymLinks
	AllowOverride None
	Require all granted

	<FilesMatch "\.(css|js|json|yml|php|xml|html|svg)$">
		SetOutputFilter DEFLATE
	</FilesMatch>

	<FilesMatch "\.(ttf|otf|eot|woff)$">
		<IfModule mod_headers.c>
			Header set Access-Control-Allow-Origin "*"
		</IfModule>
	</FilesMatch>
</Directory>