Reverse Proxy Wordpress with Lighttpd
- by Jonah
I am deploying an application and a Wordpress installation on AWS. I have Wordpress set up under Apache on an EC2, and my application under Lighttpd, and I want to reverse-proxy Wordpress through the application node. This works fine, I just set up the reverse proxy in Lighttpd as so:
$HTTP["url"] =~ "^/blog" {
proxy.server = (
"/blog" => ( "blog" => ( "host" => "123.456.789.123", "port" => 80 ))
)
}
url.rewrite-once = (
"^(.*?)$" => "/index.php/$1"
)
However, the issue is in the rewrite. When I enable rewriting, it catches it before the reverse proxy, and routes to index.php on the application server. I need it to not rewrite if it's going to the blog. I tried various regex matches and other configurations, but I haven't been able to get it to support rewriting and proxying at the same time. How can this be done?