Skip to main content
Security headers are essential for protecting your websites from common web vulnerabilities by controlling how browsers behave. This guide will walk you through the correct way to add custom security headers in ORIV, covering both OpenLiteSpeed (OLS) and NGINX web servers. In ORIV, directly editing the main server configuration files (like vhconf.conf) is not recommended, as these files are managed by the control panel and can be overwritten automatically when changes are made via the UI.

Add Custom Security Headers on OLS Servers in ORIV

Step 1: SSH Into Your Server

Before making any changes, you must SSH into your OLS server:

Step 2: Use the vhconf.server.conf Config File

Use the following file to define your custom HTTP security headers:
This file is not overwritten by the ORIV panel and is ideal for persisting manual changes such as custom headers.

Step 3: Add Security Headers

To add custom security headers, update vhconf.server.conf with the following block:

Step 4: Apply the Configuration

After updating the configuration, restart LiteSpeed to apply the changes: systemctl restart lsws && killall -9 lsphp

Add Custom Security Headers on NGINX Servers in ORIV

For NGINX-based ORIV servers, you can add custom security headers right from the ORIV Dashboard. Read this documentation for more information about custom NGINX: 👉How To Configure Custom NGINX In ORIV? 📌 Notes
  • Do not edit vhconf.conf directly – it’s automatically regenerated by the ORIV panel.
  • Use vhconf.server.conf on OLS servers to retain customizations.
  • Always restart LiteSpeed or NGINX after making changes for them to take effect.
And that’s it this is how easily you can add custom security headers in ORIV for OLS and NGINX servers. Adding custom security headers is a crucial step in hardening your website against common threats such as cross-site scripting, clickjacking, and data injection attacks.I’s important to apply these headers in a way that aligns with the platform’s configuration management to avoid losing changes during updates. Still stuck? Contact our support team for any of your queries.