Skip to content

Custom server configuration

Every CloudPress site runs on Nginx and PHP-FPM with a tuned default configuration that works well for most WordPress sites. If you have an advanced need — a custom rewrite, a non-standard cache rule, WordPress Multisite, or different PHP-FPM process limits — you can override that configuration by placing your own files in the site's nginx/ directory. (For the bigger picture of how a site runs, see The platform.)

This is an advanced, power-user feature

A broken config file can stop Nginx or PHP-FPM from starting and take your site offline. Change one file at a time, keep a copy of anything that works, and know that you can always revert by deleting your custom file and restarting (see Reverting to the defaults).

Where the files go

The override files live in the nginx/ directory at the root of your site's files:

/home/sftpuser/apps/{{ container name }}/wordpress/nginx/

Reach it with any of the file-access methods — SFTP, SSH, the File Manager, or Cloud Shell. See Accessing your files for how to connect.

The files you can override

Drop a file with one of these exact names into the nginx/ directory. Only the exact filename is used — there is no .sample or .example suffix on an active file.

File Replaces What it controls
nginx/site.conf The site's Nginx server block Webroot, location blocks, rewrites and redirects, headers, and caching rules
nginx/nginx.conf The global Nginx config Server-wide Nginx settings such as gzip, buffers, and logging
nginx/pool.conf The PHP-FPM pool config PHP process limits (pm.max_children) and settings such as upload size

Add or change a config file

  1. Open the nginx/ directory. Connect with SFTP, SSH, the File Manager, or Cloud Shell.

  2. Create the file with its exact name — site.conf, nginx.conf, or pool.conf. The easiest starting point is to base it on a known-good default (see The defaults below) and change only what you need.

  3. Restart the site. In the CloudPress dashboard, open the site's Settings and use the Restart action. Changes take effect after a restart.

WordPress Multisite

CloudPress seeds example server blocks for Multisite into the nginx/ directory — multisite-subdirectory.conf.example and multisite-subdomain.conf.example. To enable Multisite, copy the one you want to site.conf (dropping the .example suffix), adjust it as needed, and restart.

The defaults

The defaults you're most likely to tune:

  • Upload size — 100M upload and post limits.
  • PHP workers — pm.max_children = 3, pm.max_requests = 2000.
  • PHP-FPM socket — listen = /tmp/php-fpm.sock. Keep it in your own pool.conf.
  • Nginx workers — worker_processes 2.
  • FastCGI cache zone — named WORDPRESS (500 MB, 60-minute TTL). Keep the name if you use your own nginx.conf and site.conf.

A trimmed default pool.conf:

[www]
user = www-data
group = www-data
listen = /tmp/php-fpm.sock
pm = static
pm.max_children = 3
pm.max_requests = 2000

php_admin_value[upload_max_filesize] = 100M
php_admin_value[post_max_size] = 100M

Each PHP worker (pm.max_children) can use up to your PHP memory limit, so pm.max_children × per-process memory must fit inside the site's RAM. A good starting point is to match pm.max_children to the site's CPU core count, then adjust. Setting it too high can cause the site to run out of memory.

Custom site.conf and caching

If you use your own site.conf, the dashboard's cache toggle and the nginx.cache.enabled setting in cloudpress.yml no longer apply. Add your own caching rules to your file; if you want FastCGI caching, copy the fastcgi_cache rules and the $no_cache conditions from the default configuration.

Reverting to the defaults

If a customization causes problems, delete the custom file (site.conf, nginx.conf, or pool.conf) from the nginx/ directory and restart the site. CloudPress falls back to its shipped default for any file you haven't overridden, so removing your file cleanly restores the original behavior.

  • Configuration file — the cloudpress.yml file, which controls the webroot, WordPress paths, and the built-in cache toggle.
  • Scheduled tasks (cron) — add your own scheduled commands via the crontab file alongside these configs.
  • The platform — how Nginx, PHP-FPM, and your site's other containers fit together.