Skip to main content

此版本的 GitHub Enterprise 将停止服务 2022-09-28. 即使针对重大安全问题,也不会发布补丁。 要获得更好的性能、改进的安全性和新功能,请升级到 GitHub Enterprise 的最新版本。 如需升级方面的帮助,请联系 GitHub Enterprise 支持

Configuring the referrer policy for your enterprise

You can increase the privacy of 您的 GitHub Enterprise Server 实例 by configuring the policy for cross-origin requests.

About the referrer policy for your enterprise

The referrer policy controls the information that GitHub Enterprise Server transmits in HTTP headers when someone visits a link from 您的 GitHub Enterprise Server 实例 to an external site.

By default, when a user on 您的 GitHub Enterprise Server 实例 visits a link to another site from a file or comment on your instance, the request includes the hostname for your instance in plain text within the Referer header. If the link leads to an external website, the owner of the website could read the hostname for your instance in requests or log files.

You can control the information that GitHub Enterprise Server sends when a user visits a link from your instance.

Enabling the same-origin referrer policy

You can enable the same-origin referrer policy to instruct modern browsers to exclude the hostname for 您的 GitHub Enterprise Server 实例 from requests to external websites. The setting applies to all links from the web interface on your instance. By default, GitHub Enterprise Server uses the origin-when-cross-origin and strict-origin-when-cross-origin referrer policies, which means your instance's hostname will appear in HTTP and HTTPS requests to external websites.

Note: Changing the referrer policy to same-origin can affect external sites that expect a hostname in the HTTP headers for a request.

  1. 在 GitHub Enterprise Server 的右上角,单击您的个人资料照片,然后单击 Enterprise settings(Enterprise 设置)GitHub Enterprise Server 上个人资料照片下拉菜单中的"Enterprise settings(企业设置)"

  2. 在企业帐户侧边栏中,单击 Settings(设置)企业帐户侧边栏中的“设置”选项卡

  3. Under "User Agent Referrer Policy", select Enable same origin referrer policy for all organizations. Checkbox for enabling same origin referrer policy

  4. Click Save. Save button for enabling same origin referrer policy