# These modules must be enabled : rewrite, fcgid
# (mod_fastcgi is much harder to configure)
# Configuration for http://localhost:8080
<VirtualHost *:8080>
	# DefaultInitEnv for module mod_fcgid
	DefaultInitEnv RAILS_RELATIVE_URL_ROOT ""
	DefaultInitEnv X_DEBIAN_SITEID "default"

	# the mod_fcgid socket path
	SocketPath "/var/run/puppet-dashboard/sockets/default"
	Alias "/plugin_assets/" /var/cache/puppet-dashboard/default/plugin_assets/
	DocumentRoot /usr/share/puppet-dashboard/public
	<Directory "/usr/share/puppet-dashboard/public">
		Options +FollowSymLinks +ExecCGI
		Order allow,deny
		Allow from all
		RewriteEngine On
		RewriteRule ^$ index.html [QSA]
		RewriteRule ^([^.]+)$ $1.html [QSA]
		RewriteCond %{REQUEST_FILENAME} !-f [OR]
		RewriteCond %{REQUEST_FILENAME} dispatch.fcgi$
		RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
	</Directory>
</VirtualHost>
