GltLab Pages 401 - 您无权访问该资源

问题描述

经典的 GitLab 页面设置问题。似乎每次我尝试在 GitLab 页面上托管页面时都会遇到这种情况。

GltLab Pages 401 - You don't have permission to access the resource.

这一次虽然我忘记了如何克服它。所有设置看起来都正确:

CloudFlare DNS Settings

我在 Cloudflare 中关闭了域上的所有 HTTPS/TLS/SSL,只是为了更轻松地连接。

GitLab 页面设置卡在强制使用 HTTPS 上。不知道这是怎么卡住的?

GitLab Pages forcing HTTPS

更多设置:

GitLab Page 401 settings

enter image description here

enter image description here

非常感谢任何见解!谢谢。

解决方法

缺少gitlab-ci.yml

image: alpine:latest

pages:
  stage: deploy
  script:
  - echo 'Nothing to do...'
  artifacts:
    paths:
    - public
  only:
  - master

此外,还需要一个不是根目录的 public/ 文件夹。 见How to deploy plain-html site on GitLab Pages

尝试添加 gitlab-ci.ymlpublic/ 或从 GitLab 模板的 repo 创建: https://docs.gitlab.com/ce/user/project/pages/getting_started/pages_new_project_template.html

像这个: https://gitlab.com/pages/plain-html