Add gitlab-pages unique url lookup

What does this MR do and why?

depends on !109011 (merged)

Related to: #388179 (closed)

Enable gitlab pages to find sites by the unique domain.

Screenshots or screen recordings

Screen_Recording_2023-03-03_at_14.44.51

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Pre-conditions:

  1. Enable the pages unique domain feature flag

    Feature.enable(:pages_unique_domain)
  2. Create a new project using the Pages/Plain HTML template

  3. Run the project pipeline to create a gitlab-pages deploy

  4. Access the pages settings in Settings > Pages, like: http://gdk.test:3000/<project namespace>/pages

  5. Enable Use unique domain and click in Save changes

  6. Copy the URL in the Access pages > Your pages are served under: panel

  7. Remove the protocol and port from the URL and add it in you /etc/hosts pointing to localhost, something like:

    # Unique Domain
    127.0.0.1  html-root-265cd6a7f146c5ae423a42292d2f66742749a886447617895e942.pages.gdk.test
  8. You must be able to access the URL (with the protocol and port) in your browser, which mean that the lookup by the unique domain worked! 🎉

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Kassio Borges

Merge request reports

Loading