Web server management

Choose the web server for PHP websites, see how each handles .htaccess, and tune request limits, caching, HTTP/3, compression and Cloudflare.

How requests reach a website

Every request passes through two web servers:

  1. The edge. One web server on each node (nginx, or ScalWS when you choose it under Request limits) receives all traffic on ports 80 and 443. It terminates HTTPS and HTTP/3, applies request limits, the IP blocker, country blocks and hotlink protection, and passes the request to the website.
  2. The website's own web server. It runs inside the website's container, as the website's user, next to PHP-FPM. This is the server you choose on the Web server page.

The edge is nginx unless you choose ScalWS for it (see Request limits). Your choice on the Web server page only changes the web server inside PHP websites. Static websites and Node.js or Python applications always use nginx inside their container.

Choosing the web server

Open Web & software → Web server and choose one server for the whole platform. You cannot mix servers per website.

Web serverWhat it is
ScalWSSCB Network's web server, included. Reads .htaccess itself. The default for new installations.
nginxFast and light. .htaccess is translated into nginx rules.
ApacheApache httpd 2.4, built from apache.org's releases. Reads .htaccess natively.
nginx + Apachenginx in front of Apache. Apache answers every request with .htaccess; nginx handles slow clients, compression and keep-alive. It does not cache.
OpenLiteSpeedLiteSpeed's open-source server, for the LiteSpeed Cache plugin, with a reduced feature set.
LiteSpeed EnterpriseLiteSpeed's commercial server, from your own images and your own licence.
Custom web serverYour own server, from your own images, following ScalPanel's web server contract.

What happens when you switch: every PHP website's container is recreated with the new server, so each restarts once, briefly. Nothing else changes for the customer. You can switch back at any time.

An installation that already has websites keeps its current server until you change it.

.htaccess on each web server

The panel's own features (redirects, error pages, directory privacy, directory listings, MIME types) write managed blocks into .htaccess. So .htaccess support matters even for customers who never edit the file.

Web serverHow .htaccess is handled
nginxCompiled into nginx rules by ScalPanel's rules engine. Supported directives work; others are reported.
Apache, nginx + ApacheRead natively by Apache.
OpenLiteSpeedOpenLiteSpeed reads the rewrite rules. ScalPanel compiles the rest into the server's configuration.
LiteSpeed EnterpriseRead natively by LiteSpeed. ScalPanel also finds folders where PHP is turned off and refuses PHP there itself.
ScalWSRead by ScalWS itself.
CustomMust be read by your server. ScalPanel does not check it.

nginx

When a .htaccess file changes, the node notices within about 15 seconds and compiles the file tree in a sandbox. The result is checked with nginx -t and loaded without dropping connections. Customers see the result and any messages per line in the website's .htaccess report in the hosting panel.

DirectiveSupport
RewriteEngine, RewriteBase, RewriteCond, RewriteRuleSupported. Flags L, END, R, NC, QSA, QSD, F, G; PT, NS, NE accepted without effect
Redirect, RedirectMatch, RedirectPermanent, RedirectTempSupported in the top folder
Require all, Require ip, Order, Allow, DenySupported, also in sub-folders
<Files>, <FilesMatch>Supported for denying files and setting headers
<IfModule>Evaluated: rewrite, headers, expires, mime, dir, alias, authz, access_compat and setenvif count as present
AuthType Basic, AuthName, AuthUserFile, Require valid-userSupported with a password file inside the website
HeaderSupported in the top folder
ExpiresActive, ExpiresDefault, ExpiresByTypeSupported in the top folder
ErrorDocument, DirectoryIndex, AddTypeSupported in the top folder
Options IndexesSupported
php_flag engine off, SetHandler none, RemoveHandler of PHPSupported: PHP is refused in that folder
Other php_value and php_flag linesIgnored with a warning
AddHandler, other SetHandlerIgnored with a warning
AuthGroupFile, Satisfy, <RequireAll> and other access sectionsRejected

Common WordPress, Laravel and Symfony front-controller rules work.

Rejected means the whole rule set is refused, because dropping the directive could open what it protects. The website then keeps its last working rules, and the report says why. Ignored directives cannot widen access, so the rest of the file still applies.

Note: nginx does not model every Apache detail, for example Apache's repeated rewrite passes. A rule set that depends on them can behave differently. Choose Apache, ScalWS or LiteSpeed Enterprise if your customers need full Apache behavior.

OpenLiteSpeed

OpenLiteSpeed itself ignores everything in .htaccess except rewrite rules. ScalPanel therefore compiles access rules, password protection, <Files> denies, PHP-off folders, MIME types, expiry and headers into its configuration. Where it cannot express an access rule exactly, it denies the folder and says so in the report.

Not available under OpenLiteSpeed: directory listings, nginx's page cache, per-file and per-folder headers, and error pages of sub-folders. Directory privacy passwords set before bcrypt was used must be set again.

LiteSpeed Enterprise and its licence

ScalPanel cannot ship LiteSpeed Enterprise. To use it:

  1. Build one image per PHP version from ScalPanel's PHP site image, with LiteSpeed Enterprise and your licence file. ScalPanel includes an example build that was tested with LiteSpeed 6.3.7 and a trial licence.
  2. Push the images to your own registry.
  3. Under Web & software → Web server → LiteSpeed Enterprise images, enter one image per PHP version, pinned by digest (name@sha256:…).
  4. Choose LiteSpeed Enterprise. It can be chosen only when every PHP version in use has an image.

The licence is never entered in the panel. It is part of your image, which you obtain from LiteSpeed.

Warning: Every website runs its own LiteSpeed process in its own container, so make sure your licence covers that use. The licence file is inside every website's container, so treat it as visible to the website's own code. Use a licence meant for this, never a key that unlocks anything else, and push the image only to a private registry.

ScalPanel's isolation applies to your images unchanged, but the images and their updates are your responsibility. Test a new LiteSpeed release before you register it. The custom web server works the same way, with your own binary in the image.

Request limits

Web & software → Request limits tunes the edge in front of every website, whatever web server they use:

  • the largest request body (built in: 64 MiB);
  • keep-alive time (built in: 30 seconds);
  • the timeout for answers from websites (built in: 120 seconds);
  • requests per second and burst per visitor address (built in: 50 and 100);
  • compression of text answers at the edge;
  • connections per worker (built in: 4096).

The node checks every value again before it uses it.

Edge web server on the same page chooses the edge itself: nginx (default) or ScalWS. ScalWS serves the same routes, certificates, IP blocker, country blocks, hotlink protection, previews and default pages. A node switches only when its ScalWS build has every feature the configuration needs and accepts it; otherwise that node keeps nginx and its agent logs why. If the new edge does not answer its health check, the node goes back to the previous one. Website replicas need ScalWS at the edge.

Caching

Customers can turn on two caches per PHP website in the hosting panel when their package includes caching:

  • A private Redis, inside the website's container, reachable only by the website. Its memory comes out of the website's memory limit, up to the package's Redis limit (128 MiB by default). The WordPress manager can connect WordPress's object cache to it.
  • A page cache for anonymous visitors, kept for 1 to 1,440 minutes. Visitors with sign-in, session or shop cookies, and admin, sign-in, cart and checkout paths, are never cached.

The page cache works with the nginx and ScalWS web servers. With other servers the setting is kept but has no effect. With OpenLiteSpeed or LiteSpeed Enterprise, use the LiteSpeed Cache plugin instead.

HTTP/3

Every website answers over HTTP/3 (QUIC) on UDP port 443, with the same certificate. There is nothing to configure. Browsers that cannot reach UDP 443 stay on HTTP/2. Allow UDP 443 in any firewall in front of your server. The panels' own ports do not use HTTP/3.

Compression

By default each website compresses static text files (CSS, JavaScript, SVG, fonts, static HTML), but not PHP output. Compressing pages that show secrets next to visitor input can leak those secrets (the BREACH attack).

Customers change this per website on the hosting panel's Optimize Website page: static only (default), off, everything, or chosen MIME types. nginx, Apache and LiteSpeed Enterprise apply every mode. OpenLiteSpeed can only turn compression off. ScalWS and custom servers receive the choice in their site description.

Cloudflare

Customers connect their own Cloudflare account with an API token in the hosting panel, if their package includes Cloudflare. They can then:

  • copy their DNS records to Cloudflare and choose which website names go through Cloudflare's proxy. Mail and other names are never proxied;
  • edit their Cloudflare records from the DNS page;
  • purge Cloudflare's cache and switch development mode;
  • switch on "I'm Under Attack" and manage Cloudflare custom firewall rules on the Firewall (WAF) page.

The edge trusts the CF-Connecting-IP header only from Cloudflare's published networks, so logs, the IP blocker and websites see the real visitor's address. Tell customers to use Cloudflare's "Full (strict)" SSL mode, not "Flexible".