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
demyx run domain.tld --stack=nginx-php --sslnginx-php is the default stack, so --stack=nginx-php is optional.
PHP Version
# 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.4FastCGI Cache
Enable the built-in NGINX FastCGI page cache:
demyx config domain.tld --cache=trueThis 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:
demyx config domain.tld --cache=rocketThis 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:
demyx config domain.tld --rate-limit=truePHP-FPM Tuning
# 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=512mBedrock (Roots.io)
Run WordPress with Roots Bedrock on NGINX-PHP:
demyx run domain.tld --stack=bedrock --sslSwitch an existing site to Bedrock development mode:
demyx config domain.tld --bedrock=developmentSwitching to OLS
demyx config domain.tld --stack=olsNote: You cannot switch fromnginx-phptools-bedrockdirectly. The same applies for OLS to Bedrock.
Viewing NGINX Logs
# Access log
demyx log domain.tld
# Error log
demyx log domain.tld -e
# Follow access log
demyx log domain.tld -f