Configure HTTP-Security-Header in Plesk
Plesk offers the option of adding additional HTTP headers to all HTTP responses. This option should only be used if the web application used can still provide these independently.
Configuration
Log in to the Plesk Control Panel via our Customer Center at account.creoline.com. Then navigate to the website for which you want to provide additional HTTP headers and click on Apache & NGINX in the Hosting tab. In the last section under "Additional nginx instructions", add the desired headers according to the following scheme:
add_header <name of the header> <value>;
Important HTTP headers
Below we summarize some important HTTP security headers:
Strict-Transport-Security (HSTS)
This header enforces the use of HTTPS by informing the browser that the website may only be accessed via a secure connection. This prevents a user from inadvertently communicating via an insecure HTTP connection.
Example:
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Referrer-Policy
This header determines what information is sent to the target page in the Referer
header when a user navigates from one page to another. This makes it possible to control the disclosure of sensitive information about the origin of requests.
Example:
Referrer policy: no-referrer
Content-Security-Policy
This header protects against cross-site scripting (XSS) and other code injection attacks by specifying which resources (e.g. scripts, styles) may be loaded from a website. A restrictive configuration can be used to block harmful content.
Example:
Content-Security-Policy: default-src 'self'; script-src 'self' https://trusted.com
Permissions-Policy
With this header, a website can specify which APIs and functions (e.g. camera, microphone, geolocation) may be used by the browser. In this way, access to potentially abusable interfaces can be restricted.
Example:
Permissions policy: geolocation=(), microphone=()
X-Frame-Options
This header prevents clickjacking attacks by controlling whether a web page may be embedded within an `
Example:
X-Frame-Options: DENY
X-Content-Type-Options
This header can be used to instruct the browser to interpret the Content-Type
of a file strictly according to the server specification. This prevents MIME sniffing, which can lead to security vulnerabilities in some cases.
Example:
X-Content-Type-Options: nosniff
Example configuration "WordPress"
# Referrer-Policy: Controls which referrer information is sent
add_header Referrer-Policy "no-referrer-when-downgrade";
# Content-Security-Policy: Restricts the loading of external resources
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' https://trusted-cdn.com; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:; frame-ancestors 'none';";
# Permissions-Policy: Restricts access to certain APIs
add_header Permissions-Policy "geolocation=(), microphone=(), camera=(), interest-cohort=()";
# X-Frame-Options: Prevents clickjacking
add_header X-Frame-Options "SAMEORIGIN";
# X-Content-Type-Options: Prevents MIME sniffing
add_header X-Content-Type-Options "nosniff";
Please note that adjustments to the sample configuration may be necessary for your WordPress website.