Skip to content
HomeKnowledge BaseStatisticsChangelog GitHub Discord Email
tutorials / NGINX-PHP Stack

No results for ""

NGINX-PHP Stack

Overview

The nginx-php stack is the default in Demyx. It uses:

  • NGINX — high-performance web server and reverse proxy
  • PHP-FPM — PHP process manager (8.4 by default)
  • MariaDB — database

Creating a Site with NGINX-PHP

bash
demyx run domain.tld --stack=nginx-php --ssl

nginx-php is the default stack, so --stack=nginx-php is optional.

PHP Version

bash
# Set PHP 8.4 (default)
demyx run domain.tld --php=8.4

# Switch an existing app's PHP version
demyx config domain.tld --php=8.4

FastCGI Cache

Enable the built-in NGINX FastCGI page cache:

bash
demyx config domain.tld --cache=true

This installs and configures the Nginx Cache plugin. Cached pages are served directly by NGINX without touching PHP.

WP Rocket + rocket-nginx

For WP Rocket users on the nginx-php stack:

bash
demyx config domain.tld --cache=rocket

This configures rocket-nginx rules in NGINX to serve WP Rocket's cache directly.

Rate Limiting

Protect /wp-login.php and /wp-cron.php from brute-force attacks:

bash
demyx config domain.tld --rate-limit=true

PHP-FPM Tuning

bash
# Set process manager mode
demyx config domain.tld --pm=ondemand

# Set max requests per child (prevents memory leaks)
demyx config domain.tld --php-max-requests=500

# Set resource limits
demyx config domain.tld --wp-cpu=.50 --wp-mem=512m

Bedrock (Roots.io)

Run WordPress with Roots Bedrock on NGINX-PHP:

bash
demyx run domain.tld --stack=bedrock --ssl

Switch an existing site to Bedrock development mode:

bash
demyx config domain.tld --bedrock=development

Switching to OLS

bash
demyx config domain.tld --stack=ols
Note: You cannot switch from nginx-php to ols-bedrock directly. The same applies for OLS to Bedrock.

Viewing NGINX Logs

bash
# Access log
demyx log domain.tld

# Error log
demyx log domain.tld -e

# Follow access log
demyx log domain.tld -f