Skip to main content

Включение изоляции поддомена

Можно настроить изоляцию поддоменов, чтобы безопасно отделить предоставленное пользователем содержимое от других частей устройства GitHub Enterprise Server.

About subdomain isolation

Subdomain isolation mitigates cross-site scripting and other related vulnerabilities. For more information, see "Cross-site scripting" on Wikipedia. We highly recommend that you enable subdomain isolation on your GitHub Enterprise Server instance.

When subdomain isolation is enabled, GitHub Enterprise Server replaces several paths with subdomains. After enabling subdomain isolation, attempts to access the previous paths for some user-supplied content, such as http(s)://HOSTNAME/raw/, may return 404 errors.

Note: The http(s)://notebooks.HOSTNAME or http(s)://viewscreen.HOSTNAME subdomains are new in GitHub Enterprise Server 3.7 and later, and replace http(s)://render.HOSTNAME. After you upgrade to 3.7 or later, your TLS certificate must cover the subdomain for the replacement services, http(s)://notebooks.HOSTNAME and http(s)://viewscreen.HOSTNAME.

Path without subdomain isolationPath with subdomain isolation
Not supportedhttps://containers.HOSTNAME/


Warning: If subdomain isolation is disabled, we recommend also disabling GitHub Pages on your enterprise. There will be no way to isolate user-supplied GitHub Pages content from the rest of your enterprise's data. For more information, see "Configuring GitHub Pages for your enterprise."

Before you enable subdomain isolation, you must configure your network settings for your new domain.

  • Specify a valid domain name as your hostname, instead of an IP address. For more information, see "Configuring a hostname."

Warning: Do not change the hostname for GitHub Enterprise Server after initial setup. Changing the hostname will cause unexpected behavior, up to and including instance outages. If you have changed the hostname for your instance and are experiencing problems, contact GitHub Enterprise Support or GitHub Premium Support.

  • Set up a wildcard Domain Name System (DNS) record or individual DNS records for the subdomains listed above. We recommend creating an A record for *.HOSTNAME that points to your server's IP address so you don't have to create multiple records for each subdomain.
  • Get a wildcard Transport Layer Security (TLS) certificate for *.HOSTNAME with a Subject Alternative Name (SAN) for both HOSTNAME and the wildcard domain *.HOSTNAME. For example, if your hostname is, get a certificate with the Common Name value set to * and a SAN value set to both and *
  • Enable TLS on your appliance. For more information, see "Configuring TLS."

Enabling subdomain isolation

  1. From an administrative account on GitHub Enterprise Server, in the upper-right corner of any page, click .

  2. If you're not already on the "Site admin" page, in the upper-left corner, click Site admin.

  3. In the " Site admin" sidebar, click Management Console.

  4. In the "Settings" sidebar, click Hostname.

  5. Select Subdomain isolation (recommended).

  6. Under the "Settings" sidebar, click Save settings.

    Note: Saving settings in the Management Console restarts system services, which could result in user-visible downtime.

  7. Wait for the configuration run to complete.