If we do not want to define a common policy for the entire server, we can define security headers per user, through DirectAdmin.

We go to the Dashboard > Custom HTTPD Configurations menu.

We select the user we want and open the openlitespeed.conf file

We click the Customize button at the top right to enter our rules.

On the next screen, we select the CUSTOM7 tab.

We enter the following content and press the SAVE button at the bottom right.

After adding the required headers, we need to recreate the domain settings and restart OpenLiteSpeed:

We check if our rating has improved on the website securityheaders.com