---
schema_version: "1"
id: 938989225bab65a749ac7297407f8fa5d5fc33d70b4491d6fbf48c1ebb1a7eaf
title: HTTP 回應標頭
collection: tableau
version: next
locale: zh-tw
portal_url: https://docs.salesforce.com/tableau/next/zh-tw/server/security_http_headers.md
canonical_url: https://help.tableau.com/v0.0/server/zh-tw/security_http_headers.htm
source_site: help.tableau.com
content_type: documentation
content_hash: c60ec26c9c53e38d61c4c5ac598bf2424726f6f9f692885106e3eb4b5f7cc3cf
description: Configure HTTP response headers such as HSTS and Referrer-Policy on Tableau Server.
---
[跳至主要內容](#main-content)

# HTTP 回應標頭

Tableau Server 支援 [OWASP Secure Headers Project](https://owasp.org/www-project-secure-headers/#div-headers) 中指定的部分回應標頭。

本主題說明如何針對 Tableau Server 設定下列回應標頭：

- HTTP 嚴格傳輸安全性 (HSTS)
- Referrer-Policy
- X-Content-Type-Options
- X-XSS-Protection

Tableau Server 也支援內容安全性原則 (CSP) 標準。本主題內容並未涵蓋 CSP 設定。請參閱[內容安全性原則](https://help.tableau.com/v0.0/server/zh-tw/security_csp.htm)。

## 設定 HTTP 回應標頭

所有回應標頭都可使用 [tsm configuration set](https://help.tableau.com/v0.0/server/zh-tw/cli_configuration_tsm.htm#TSMSet) 命令設定。

在完成回應標頭設定後，請執行 [tsm pending-changes apply](https://help.tableau.com/v0.0/server/zh-tw/cli_pending-changes.htm#pending-changes-apply)。

如果擱置組態需要重新啟動伺服器，`pending-changes apply` 命令將顯示提示，讓您知道即將重新啟動。即使伺服器已停止，也會顯示提示，但在這種情況下不會重新啟動。您可以使用 `--ignore-prompt` 選項隱藏提示，但這樣做不會改變重新啟動行為。如果變更不需要重新啟動，則不會出現提示即可套用變更。有關詳情，請參閱 [tsm pending-changes apply](https://help.tableau.com/v0.0/server/zh-tw/cli_pending-changes.htm#pending-changes-apply)。

## HTTP 嚴格傳輸安全性 (HSTS)

HSTS 會強制連線至 Tableau Server 的用戶端使用 HTTPS 進行連線。有關詳情，請參閱 OWASP 項目 [HTTP 嚴格傳輸安全性 (HSTS)](https://owasp.org/www-project-secure-headers/#div-headers)。

### 選項

gateway.http.hsts

預設值：`false`

HTTP 嚴格傳輸安全性 (HSTS) 頭強制瀏覽器在啟用它的域上使用 HTTPS。

gateway.http.hsts\_options

預設值：`"max-age=31536000"`

預設情況下，會為一年（31536000 秒）期間設定 HSTS 原則。此時間段指定瀏覽器將透過 HTTPS 存取伺服器的時間量。

## Referrer-Policy

自 2019.2 之後的版本，Tableau Server 即加入可設定 Referrer-Policy HTTP 標頭行為的功能。此原則將藉由預設行為啟用，並針對所有「視為安全」的連線加入原始 URL（原則 `no-referrer-when-downgrade`）。在舊版中，Referrer-Policy 標頭未包含在由 Tableau Server 傳送的回應中。有關 Referrer-Policy 支援的各種原則選項的詳情，請參閱 OWASP 項目 [Referrer-Policy](https://owasp.org/www-project-secure-headers/#div-headers)。

### 選項

gateway.http.referrer\_policy\_enabled

預設值：`true`

若要排除由 Tableau Server 傳送的 Referrer-Policy 標頭，請將此值設為 `false`。

gateway.http.referrer\_policy

預設值：`no-referrer-when-downgrade`

此選項會為 Tableau Server 定義參照網址原則。您可指定 OWASP 頁面上 [Referrer-Policy](https://owasp.org/www-project-secure-headers/#div-headers) 資料表中所列的任何原則值字串。

## X-Content-Type-Options

X-Content-Type-Options 回應 HTTP 頭指定 Content-Type 頭中的 MIME 類型不應由瀏覽器變更。在某些情況下，如果未指定 MIME 類型，則瀏覽器可能會透過評估有效負載的特徵來嘗試確定 MIME 類型。然後瀏覽器將相應地顯示內容。這個過程被稱為 \[嗅探\] 。誤解 MIME 類型可能會導致安全性漏洞。

有關詳情，請參閱 OWASP 項目 [X-Content-Type-Options](https://owasp.org/www-project-secure-headers/#div-headers)。

### 選項

gateway.http.x\_content\_type\_nosniff

預設值：`true`

預設情況下，系統使用此選項將 X-Content-Type-Options HTTP 頭設定為 \[nosniff\] 。

## X-XSS-Protection

HTTP X-XSS-Protection 回應頭會傳送到瀏覽器以啟用跨網站指令碼 (XSS) 保護。在使用者在瀏覽器中停用XSS 保護的情況下，X-XSS-Protection 回應頭會覆蓋設定。

有關詳情，請參閱 OWASP 項目 [X-XSS-Protection](https://owasp.org/www-project-secure-headers/#div-headers)。

### 選項

gateway.http.x\_xss\_protection

預設值：`true`

預設情況下，系統使用此選項啟用了 X-XSS-Protection 回應頭。

## 此區段的其他文章