Reverse Proxy Wordpress with Lighttpd

Posted by Jonah on Server Fault See other posts from Server Fault or by Jonah
Published on 2012-09-11T21:31:15Z Indexed on 2012/09/11 21:40 UTC
Read the original article Hit count: 284

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?

© Server Fault or respective owner

Related posts about php

Related posts about amazon-ec2