I use apache Apache/2.4.25. I use its reverse proxy for gogs which is a git repository docker container image.

The important is that I use basic authentication. I am able to visit web site and to use git clone. The only one I can't make git push work.

The reason is that there is only one time credential asking. Yes. It is only one time. In addition, I have no way to make gogs container to handle this matter.

So, I wonder a possibility on Apache to handle this matter if " block" is able to skip the basic authentication asking via regex. => QUESTION

Here I analyze the query via GIT_CURL_VERBOSE=1 git push. I see there is a url with arguments(those parameters after question mark).

GET /username/repo.git/info/refs?service=git-upload-pack

Is Apache able to write a regex for matching the above query and make the basic authentication stop to ask credentials?

Here it's apache configuration.

<VirtualHost *:80>
  ServerAdmin admin@localhost
  DocumentRoot /var/www/docker-gogs/data/gogs
  ServerName myserver.org
  ServerAlias myserver.org
  <Proxy *>
    Options +FollowSymLinks +Multiviews +Indexes
    AllowOverride None
    AuthType basic
    AuthName "private"
    AuthUserFile /etc/apache2/.htpasswd
    Require valid-user
    AllowOverride All
    Order allow,deny
    allow from all
  ProxyRequests off
  ProxyPass /
  ProxyPassReverse /
  ErrorLog /var/log/apache2/gogs-error_log
  CustomLog /var/log/apache2/gogs-access_log common

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.