What triggers a custom 403.html?

The GitLab Pages documentation mentions that you can create custom 403.html files, in the same way you can 404.html files:

When I create a custom 404 it works as specified, but I can’t seem to trigger the custom 403 page on gitlab.com.

I’ve tried:

  • Accessing a private GitLab Pages site with custom 403 when I’m logged out.
  • Accessing a private GitLab Pages site custom 403 when I’m logged in as another user and I don’t have permission to view it.

Neither triggers the custom 403, which is a shame because I’d like to be able to inform users why they don’t have access to my GitLab Pages site. And it doesn’t seem to be documented anywhere.

What is the custom 403.html file for and how do you trigger it? Is this a feature just for EE users?

I did not test it, but I think that triggering HTTP 403 forbidden can work through access control for a public project, where only project members can access Pages. GitLab Pages access control | GitLab Try to view the site with a logged-in user that is not part of the project then.

I tried switching the project to public and pages to project-members-only visibility, but I still can’t trigger a custom 403. Whether I’m logged out or logged in as another user I just get the default 404.