gpt4 book ai didi

ruby-on-rails - GitLab 安装后重定向到第 422 页

转载 作者:行者123 更新时间:2023-12-04 06:03:35 24 4
gpt4 key购买 nike

我按照他们的 documentation 安装了 GitLab页。服务器可以作为 http://foobar.com/gitlab 访问.我有乘客 + apache 安装。 ( unicorn 也在运行)。安装完成后,它会加载登录页面,当我输入默认用户名/密码(root/5iveL!fe)时,它重定向到 422 页面并显示以下错误:

422
The change you requested was rejected.

我想可能密码有问题,尝试 reset password from console但是在运行时 gitlab-rails console productionsudo -u git -H gitlab-rails console production我收到以下错误:
ls: cannot access /opt/gitlab/embedded/service/gitlab-rails/log: No such file or directory
chpst: fatal: unknown user/group: -U

由于第一个错误是因为没有日志文件,我手动创建了一个日志文件,但在运行命令后出现以下错误:
chpst: fatal: unable to setgroups: permission denied

我不知道还能做什么。同样在 production.log 中,它提示 CSR token 无效。我认为这意味着我没有提供正确的密码,但这是 GitLab 安装提供的密码。

也可能是相关的,我用过这个 guide配置apache。 GitLab 的 Apache vhost 部分如下所示
 35  ProxyPass→→ → → /gitlab/→ http://127.0.0.1:8080/gitlab/
36 ProxyPassReverse →/gitlab/→ http://127.0.0.1:8080/gitlab/
37 ProxyPass→→ → → /gitlab http://127.0.0.1:8080/gitlab
38 ProxyPassReverse /gitlab http://127.0.0.1:8080/gitlab
39 ProxyPass→→ → → /assets→→ http://127.0.0.1:8080/gitlab/assets
40 ProxyPassReverse /assets→ http://127.0.0.1:8080/gitlab/assets

最佳答案

由于没有人回答,我将发布我的解决方案,以便其他人可能会发现它有益。
问题出在 https 上。如果我在 gitlab.yml (https: false) 中关闭了 https 选项,那么我就可以登录了。详细解决方法可以查看here .我必须在我的虚拟主机(因为我有一个用于 foobar.com.conf 和 foobar.com-ssl.conf)文件中添加以下内容。

在 foobar.com.conf 文件中,我必须添加:

 RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [NE,R,L]

在 foobar.com-ssl.conf 中,我必须添加:
  RewriteRule .* http://127.0.0.1:8080%{REQUEST_URI} [P,QSA]
RequestHeader set X_FORWARDED_PROTO 'https'

有关更多故障排除问题,请访问 here .

关于ruby-on-rails - GitLab 安装后重定向到第 422 页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31588137/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com