30 lines
978 B
ApacheConf
30 lines
978 B
ApacheConf
<VirtualHost *:443>
|
|
ServerName <servername>
|
|
|
|
SSLEngine on
|
|
SSLCertificateFile /etc/letsencrypt/live/<servername>/fullchain.pem
|
|
SSLCertificateKeyFile /etc/letsencrypt/live/<servername>/privkey.pem
|
|
|
|
SetEnv GIT_PROJECT_ROOT /srv/git
|
|
SetEnv REMOTE_USER $REDIRECT_REMOTE_USER
|
|
|
|
ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/
|
|
|
|
<Directory "/usr/libexec/git-core">
|
|
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
|
|
Require all granted
|
|
AllowOverride None
|
|
</Directory>
|
|
|
|
<Files "git-http-backend">
|
|
AuthType Basic
|
|
AuthName "Git Access"
|
|
AuthUserFile /srv/git/.htpasswd
|
|
Require expr !(%{QUERY_STRING} -strmatch '*service=git-receive-pack*' || %{REQUEST_URI} =~ m#/git-receive-pack$#)
|
|
Require valid-user
|
|
</Files>
|
|
ProxyPassMatch ^/git/ !
|
|
ProxyPreserveHost On
|
|
ProxyPass / http://127.0.0.1:8000/
|
|
ProxyPassReverse / http://127.0.0.1:8000/
|
|
</VirtualHost>
|