Apache virtual host proxy to nginx for ruby

Posted by Kevin Brown on Server Fault See other posts from Server Fault or by Kevin Brown
Published on 2012-03-21T18:21:21Z Indexed on 2012/03/22 5:32 UTC
Read the original article Hit count: 559

Filed under:
|
|
|

I'm running a few php sites off apache and want to start rails dev.

I've installed rvm/nginx and can get my ruby site by going to websiteroot.com:8000...

How do I pass ruby.websiteroot.com to websiteroot.com:8000?

What's the best way for me to route a subdomain for ruby dev?? I'd switch to nginx completely if it weren't for all my php sites--seems like it's easier to just proxy for ruby.

Advice?

My nginx config looks like this:

server{
  listen 8000;
  server_name website.com;
  root /home/me/sites/ruby_folder/public;
  ...
}

My apache config looks like this:

<VirtualHost>
  ServerName ruby.website.com
  ProxyPreserveHost on
  ProxyPass / http://127.0.0.1:8000
  ProxyPassReverse / http://127.0.0.1:8000
</VirtualHost>

© Server Fault or respective owner

Related posts about apache2

Related posts about ubuntu