Add Security Headers
2 min
Complete the following steps to add new security headers to Belden Horizon Data Manager.
Security Header Directives
Refer to the following directives when completing the steps below.
add_header Content-Security-Policy "default-src 'self' https://static.zdassets.com https://ekr.zdassets.com;";
add_header X-Frame-Options SAMEORIGIN;
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options nosniff;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload; always;";
add_header Referrer-Policy "strict-origin-when-cross-origin";Add New Security Headers
- Connect to Belden Horizon Data Manager through SSH. Refer to Access to Belden Horizon Data Manager for default login credentials.
- Open or create the following file: /etc/nginx/snippets/sec-hdrs.conf.
- If the file exists, run the following command to create a backup by running the copy command. cp /etc/nginx/snippets/sec-hdrs.conf /etc/nginx/snippets/sec-hdrs.conf.bak
- Add or modify the file by using the directives above in Security Header Directives.
- Use the add_header directive to add your header. Ensure that each add_header statement ends with a semicolon (;).
- If a header has components separated by semicolons, use double quotation marks ("") to enclose the text.
- After editing the file, validate the Nginx configuration with the following command. sudo nginx -t
- If the validation passes without errors, reload Nginx to apply the changes with the following command. sudo systemctl reload nginx