Add Security Headers
2 min
Complete the following steps to add new security headers to Litmus Edge 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 https://ekr.zendesk.com https://litmus.zendesk.com https://*.zopim.com https://zendesk-eu.my.sentry.io wss://litmus.zendesk.com wss://*.zopim.com; img-src 'self' https://litmus.zendesk.com https://media.smooch.io https://v2assets.zopim.io https://static.zdassets.com data:; font-src 'self' data:; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://api.smooch.io https://cdn.segment.com/ https://www.googletagmanager.com https://static.zdassets.com; style-src * blob: 'unsafe-inline'; connect-src 'self' https://api.segment.io/ https://ekr.zdassets.com https://litmus.zendesk.com wss://widget-mediator.zopim.com https://api.smooch.io https://*.config.smooch.io wss://api.smooch.io;";
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 Litmus Edge Manager through SSH. Refer to Access Litmus Edge 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