Skip to content

Pages NGINX configuration for namespace in path

Naman Jagdish Gala requested to merge ngala/namespace-in-path-pages-nginx into master

What does this MR do?

The logic for namespace in path for Pages has been shifted from NGINX to Pages code base. In this MR, we are removing that extra NGINX configuration.

NGINX configuration has been updated to allow either namespace in path or namespace in host (i.e. wildcard) and NOT both (Reference).

Test Plan:

  1. Install CE build from this MR.
  2. Enable namespace in path: https://docs.gitlab.com/ee/administration/pages/#pages-domain-without-wildcard-dns
  3. Check the GitLab Pages NGINX configuration at /var/opt/gitlab/nginx/conf/gitlab-pages.conf. There should be one server block with the following server_name when pages_external_url is https://pages.example.io/:
server_name  ~^pages\.example\.io$;
To test with a Pages binary that supports namespace in the path:
  1. Clone the GitLab Pages code: git clone https://gitlab.com/gitlab-org/gitlab-pages.git
  2. Go inside the cloned directory: cd gitlab-pages
  3. Perform git pull if repo is not recently updated.
  4. Checkout the ngala/namespace-in-path-handler branch: git checkout ngala/namespace-in-path-handler (As Pages MR got merged)
  5. Stop the GitLab Pages process: sudo gitlab-ctl stop gitlab-pages
  6. Prepare the Pages binary: sudo make build
  7. Transfer the binary (Replace <PAGES_DIRECTORY> with the above cloned location): sudo mv <PAGES_DIRECTORY>/bin/gitlab-pages /opt/gitlab/embedded/bin/
  8. Restart the GitLab Pages process: sudo gitlab-ctl start gitlab-pages
  9. Log in to GitLab and create a public HTML project from the template: https://docs.gitlab.com/ee/user/project/pages/getting_started/pages_new_project_template.html
  10. When the pipeline is finished, go to Deploy > Pages to find the link to the Pages website.
  11. Verify that the namespace is included in the path (e.g., https://<PAGES_URL>/namespace/<PROJECT_NAME>) and that navigating to the Pages URL loads the Pages static website.

Changelog: added

Related issues

Omnibus configuration - Pages without DNS wildc... (#8581 - closed)

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion.

Required

  • MR title and description are up to date, accurate, and descriptive.
  • MR targeting the appropriate branch.
  • Latest Merge Result pipeline is green.
  • When ready for review, MR is labeled "~workflow::ready for review" per the Distribution MR workflow.

For GitLab team members

If you don't have access to this, the reviewer should trigger these jobs for you during the review process.

  • The manual Trigger:ee-package jobs have a green pipeline running against latest commit.
  • If config/software or config/patches directories are changed, make sure the build-package-on-all-os job within the Trigger:ee-package downstream pipeline succeeded.
  • If you are changing anything SSL related, then the Trigger:package:fips manual job within the Trigger:ee-package downstream pipeline must succeed.
  • If CI configuration is changed, the branch must be pushed to dev.gitlab.org to confirm regular branch builds aren't broken.

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes.
  • Documentation created/updated.
  • Tests added.
  • Integration tests added to GitLab QA.
  • Equivalent MR/issue for the GitLab Chart opened.
  • Validate potential values for new configuration settings. Formats such as integer 10, duration 10s, URI scheme://user:passwd@host:port may require quotation or other special handling when rendered in a template and written to a configuration file.
Edited by Naman Jagdish Gala

Merge request reports