I'm trying to configure git-http-backend over nginx, but without success.
My configuration is:
--------------------------------------------------
mkdir -p /var/git/repo1
cd /var/git/repo1
git init --bare
git update-server-info
chown -R nginx:nginx /var/git
--------------------------------------------------
File /etc/nginx/conf.d/default.conf:
--------------------------------------------------
server {
listen 80;
server_name _;
root /var/www;
include /etc/nginx/default.d/*.conf;
location / {
root /var/www;
index index.php index.html index.htm;
}
location ^~ /git(/.*) {
auth_basic "Basic Auth";
auth_basic_user_file /etc/nginx/htpasswdg;
gzip off;
access_log /var/log/nginx/access_git.log main;
error_log /var/log/nginx/error_git.log error;
client_max_body_size 0;
include /etc/nginx/fastcgi_params;
include /etc/nginx/fastcgi.conf;
fastcgi_param SCRIPT_FILENAME /usr/libexec/git-core/git-http-backend;
fastcgi_param DOCUMENT_ROOT /usr/libexec/git-core;
fastcgi_param SCRIPT_NAME git-http-backend;
fastcgi_param GIT_HTTP_EXPORT_ALL "";
fastcgi_param GIT_PROJECT_ROOT /var/www/git/;
fastcgi_param PATH_INFO $uri;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
}
location ^~ /pass {
auth_basic "Basic Auth";
auth_basic_user_file /etc/nginx/htpasswdg;
}
}
--------------------------------------------------
Git clone is working correctly, but with push I got error:
error: Cannot access URL http://104.128.226.101/git/repo1/, return code 22
fatal: git-http-push failed
or
error: Cannot access URL http://git:git@104.128.226.101/git/repo1/, return code 22
fatal: git-http-push failed
In logs I see:
GET /git/repo1/info/refs?service=git-receive-pack HTTP/1.1" 200 0"git/1.9.5.msysgit.1" "-"
GET /git/repo1/HEAD HTTP/1.1" 200 23 "-" "git/1.9.5.msysgit.1" "-"
PROPFIND /git/repo1/ HTTP/1.1" 405 173 "-" "git/1.9.5.msysgit.1" "-"
Web browser can open link 10.128.226.101/git/repos.git/HEAD without password!! and I see:
ref: refs/heads/master
With 10.128.226.101/pass I have authorization window.
What is wrong with my configuration? How to debug PROPFIND 405 error ?
My configuration is:
--------------------------------------------------
mkdir -p /var/git/repo1
cd /var/git/repo1
git init --bare
git update-server-info
chown -R nginx:nginx /var/git
--------------------------------------------------
File /etc/nginx/conf.d/default.conf:
--------------------------------------------------
server {
listen 80;
server_name _;
root /var/www;
include /etc/nginx/default.d/*.conf;
location / {
root /var/www;
index index.php index.html index.htm;
}
location ^~ /git(/.*) {
auth_basic "Basic Auth";
auth_basic_user_file /etc/nginx/htpasswdg;
gzip off;
access_log /var/log/nginx/access_git.log main;
error_log /var/log/nginx/error_git.log error;
client_max_body_size 0;
include /etc/nginx/fastcgi_params;
include /etc/nginx/fastcgi.conf;
fastcgi_param SCRIPT_FILENAME /usr/libexec/git-core/git-http-backend;
fastcgi_param DOCUMENT_ROOT /usr/libexec/git-core;
fastcgi_param SCRIPT_NAME git-http-backend;
fastcgi_param GIT_HTTP_EXPORT_ALL "";
fastcgi_param GIT_PROJECT_ROOT /var/www/git/;
fastcgi_param PATH_INFO $uri;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
}
location ^~ /pass {
auth_basic "Basic Auth";
auth_basic_user_file /etc/nginx/htpasswdg;
}
}
--------------------------------------------------
Git clone is working correctly, but with push I got error:
error: Cannot access URL http://104.128.226.101/git/repo1/, return code 22
fatal: git-http-push failed
or
error: Cannot access URL http://git:git@104.128.226.101/git/repo1/, return code 22
fatal: git-http-push failed
In logs I see:
GET /git/repo1/info/refs?service=git-receive-pack HTTP/1.1" 200 0"git/1.9.5.msysgit.1" "-"
GET /git/repo1/HEAD HTTP/1.1" 200 23 "-" "git/1.9.5.msysgit.1" "-"
PROPFIND /git/repo1/ HTTP/1.1" 405 173 "-" "git/1.9.5.msysgit.1" "-"
Web browser can open link 10.128.226.101/git/repos.git/HEAD without password!! and I see:
ref: refs/heads/master
With 10.128.226.101/pass I have authorization window.
What is wrong with my configuration? How to debug PROPFIND 405 error ?