我有以下 Apache 配置:
ServerName localhost
UseCanonicalName Off
LogLevel debug
<VirtualHost *:8080>
ServerName _default_
VirtualDocumentRoot /Users/alex/Sites/op3/cms/account/%-2/domain/%-3+/webroot
DirectoryIndex index.php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L,PT]
LogLevel rewrite:trace6
LogLevel proxy:trace6
ProxyPassMatch ^/(.+\.php)(\?.*)?$ fcgi://127.0.0.1:9000/Users/alex/Sites/op3/cms/$1$2
<Directory /Users/alex/Sites/op3/cms>
Options +Indexes
Require all granted
</Directory>
</VirtualHost>
中的路径ProxyPassMatch
不正确,但我不确定应该如何构建路径。在 ProxyPassMatch 中使用相同的%-2
和%-3+
令牌似乎不起作用。我尝试使用我找到的另一个解决方案,但我能想到的最好的办法是:
ProxyPassMatch ^/(.*\.php(/.*)?)$ unix:/var/run/php5-fpm.sock|fcgi://localhost:9000/Users/alex/Sites/op3/cms/account/%-2/domain/%-3+/webroot/$1
...这也不起作用。
有任何想法吗?