I am new to setting up an Git repository via http with Nginx (not Apache) I found this guide, it seemed a very simple solution.
I was able to create a repository and use git clone
commands, however when i try to push changes to remote repository, I got following message from client
#git push origin master
XML error: not well-formed (invalid token)
error: no DAV locking support on http://192.168.80.128/git/it-knowledge.git/
fatal: git-http-push failed
Could anyone help me to figure out what mistakes I made ? About DAV locking support, I searched and see some threads about DAV locking file with Apache, is there any equivalent configuration on NginX in order to push changes successfully ?
Below are my nginx configuration file for the git path, my nginx was already installed with --with-http_dav_module
option
server {
listen 80;
server_name 192.168.80.128;
client_body_temp_path /tmp/client_temp;
location ~ /git(/.*) {
dav_methods PUT DELETE MKCOL COPY MOVE;
create_full_put_path on;
dav_access user:rw group:rw all:rw;
autoindex on;
client_max_body_size 10G;
fastcgi_pass localhost:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /usr/libexec/git-core/git-http-backend;
fastcgi_param GIT_HTTP_EXPORT_ALL "";
fastcgi_param GIT_PROJECT_ROOT /srv/git;
fastcgi_param PATH_INFO $1;
}
}