Installing GitLab from source and configuring GitLab Mattermost

Hey @alexjironkin I’m not sure how much help this will be as my setup isn’t working either, but my installation seems to have different issues than yours. Here is how I setup my Apache virtual host:

<VirtualHost *:443>
	ServerName mattermost.alerque.com
	DocumentRoot /usr/share/webapps/mattermost/web

	SSLEngine on
	SSLCertificateFile    /etc/httpd/ssl.crt/alerque.com.crt
	SSLCertificateKeyFile /etc/httpd/ssl.key/alerque.com.key

	ProxyPreserveHost On

	RewriteEngine On
	RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
	RewriteRule .* http://127.0.0.1:8065%{REQUEST_URI} [P,QSA]
	RequestHeader set X_Forwarded_Proto "https"

	<Location />
		Require all granted
		ProxyPassReverse https://mattermost.alerque.com/
	</Location>

	LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common_forwarded
	ErrorLog  /var/log/httpd/mattermost.alerque.com_error.log
	CustomLog /var/log/httpd/mattermost.alerque.com_forwarded.log common_forwarded
	CustomLog /var/log/httpd/mattermost.alerque.com_access.log combined env=!dontlog
	CustomLog /var/log/httpd/mattermost.alerque.com.log combined
</VirtualHost>

Note this is for Apache 2.4 and an SSL enabled virtual host. A separate config handles redirecting non SSL requests from port 80 to this virtual host. If you are not using SSL you would obviously drop the SSL* config items and run this on *:80 or your name based equivalent. Also it looks like you are trying to use a folder path rather than a dedicated subdomain so you will need to use different path specs for both the rewrite rule and the location block.

Again this may or may not actually be right as I have problems of my own, but I think I’m passed the error you are hitting because I at least get a functional site through the proxy.