HTTP Security Headers for Port 80/443

metrovps

New member
Joined
Oct 28, 2022
Messages
11
Hello,

How to set HTTP headers for global vhost ? I mean, When we hit the DirectAdmin installed IP, it opens /var/www/html path. I'm using OpenLiteSpeed.

DirectAdmin has feature to set Strict-Transport header for port 2222 but not on Port 80/443.

I need specifically the headers from https://securityheaders.com/ when I hit the IP (http/https - 80/443). Can it be set ? If yes, then from where for OpenLiteSpeed WebServer ??

Regards.
 
For IPs the following files are responsible:

Apache/LiteSpeed:

- /etc/httpd/conf/ips.conf
- /etc/httpd/conf/extra/httpd-vhosts.conf

Nginx:

- /etc/nginx/nginx-vhosts.conf

OpenLiteSpeed:

- /usr/local/lsws/conf/httpd-vhosts.conf

But do not edit them directly, you should find and use corresponding templates under custombuild/ and templates/ folders.

p.s. Actually there is no much sense to add those headers for IPs.
 
and I used in htaccess not worked

OpenLiteSpeed does not support all features of htaccess, only limited support is provided. If you need to customize a single virtual host, then you could use

- DirectAdmin interface at an admin level: Admin Panel -> Admin Settings -> Customize Httpd Configurations. Details can be found here: https://docs.directadmin.com/webser...ing-custom-httpd-conf-code-to-the-virtualhost
- Or customize templates, if you want it for all hosted domains: https://docs.directadmin.com/webser...set-up-webmail-example-com-with-openlitespeed
 
Back
Top