Files
cloud-apache-container/configs/shared-vhost-template.tpl
jknapp 1490bde56e
Some checks failed
Cloud Apache Container / Build-and-Push (74) (push) Successful in 2m7s
Cloud Apache Container / Build-and-Push (80) (push) Successful in 1m59s
Cloud Apache Container / Build-and-Push (81) (push) Successful in 2m3s
Cloud Apache Container / Build-and-Push (82) (push) Successful in 2m26s
Cloud Apache Container / Build-and-Push (83) (push) Successful in 2m21s
Cloud Apache Container / Build-and-Push (84) (push) Successful in 1m51s
Cloud Apache Container / Build-FPM-Images (74) (push) Has been cancelled
Cloud Apache Container / Build-FPM-Images (80) (push) Has been cancelled
Cloud Apache Container / Build-FPM-Images (81) (push) Has been cancelled
Cloud Apache Container / Build-FPM-Images (82) (push) Has been cancelled
Cloud Apache Container / Build-FPM-Images (83) (push) Has been cancelled
Cloud Apache Container / Build-FPM-Images (84) (push) Has been cancelled
Cloud Apache Container / Build-FPM-Images (85) (push) Has been cancelled
Cloud Apache Container / Build-Shared-httpd (push) Has been cancelled
Cloud Apache Container / Build-and-Push (85) (push) Has been cancelled
Switch shared vhost from SetHandler to ProxyPassMatch for PHP-FPM
SetHandler + ProxyFCGISetEnvIf doesn't work for path remapping because
reqenv('SCRIPT_FILENAME') is empty when the directive evaluates with
the SetHandler approach.

ProxyPassMatch directly maps .php URLs to the FPM container's filesystem
path, bypassing the SCRIPT_FILENAME rewrite issue entirely:
  ^/(.*\.php(/.*)?)$ -> fcgi://fpm:9000/home/{user}/public_html/$1

Static assets (CSS, JS, images) bypass the proxy since they don't match
\.php and are served directly by Apache from the read-only mount.

Tested and confirmed working on live site with WordPress (including
pretty URLs via .htaccess mod_rewrite).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 12:50:54 -07:00

1.4 KiB