出現了The HTTP server did not provide the username in the Authorization header when it forwarded the request to Gerrit Code Review. 這個錯誤的時候。
location / {
auth_basic "Gerrit Code Review";
#這裏漏了
auth_basic_user_file /passwords;
proxy_pass http://127.0.0.1:8888;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
}
增加一句就好
auth_basic_user_file /passwords;
gerrit創建用戶
htpasswd -c /passwords admin 創建文件,並新增一個用戶
htpasswd -m /passwords admin 新增一個用戶