Currently my blog is hosted at blog.domain.com and is hosted on a LAMP stack and running wordpress. This is where I have the blog.domain.com DNS a record point to.
I also have domain.com hosted on an nginx server and is going to run my ecommerce app (magento). The domain.com dns a record points here. We put both applications on sepparate servers for security reasons.
I wanted to move the blog to domain.com/blog for seo reasons. What I did was set up a reverse proxy with nginx as a frontend cache for the apache/wordpress backend. So this is working beautifully and I have noticed the caching is really improving my load times.
Now I need to redirect all my blog.domain.com requests to domain.com/blog. But what is the best approach? Should I change the dns a record for blog.domain.com to my nginx server and then have nginx process the rewrite/redirect? Or should I put the rewrite on the apache server? I only have access the the .htaccess file on the Apache server.
I haven't ever done this so I thought I'd ask the community what is the best approach for situations like this.