Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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>
share|improve this question
    
Can you clarify what the issue is? You're preserving the host header from the client request. Is that not what you're seeing sent to nginx? –  Shane Madden Mar 22 '12 at 2:50
    
I'm not sure if nginx is seeing anything, but I'm fairly certain that apache is seeing a request. I'm a noob... –  Kevin Brown Mar 22 '12 at 3:10
add comment

1 Answer

up vote 0 down vote accepted

listen: 8000; is invalid syntax - it should be listen 8000;. Is nginx even starting successfully?

share|improve this answer
    
You're right. My typo... Nginx is starting correctly. –  Kevin Brown Mar 22 '12 at 4:23
    
Ok - so can you clarify what your issue is? What happens when you attempt to access the site with a browser? –  Shane Madden Mar 22 '12 at 5:08
    
You can see it now: pixelcraftwebdesign.com:8000 works, but ruby.pixelcraftwebdesign.com doesn't...I don't know why. I want the subdomain to point to the 8000 port, I think. –  Kevin Brown Mar 22 '12 at 5:11
    
The DNS name ruby.pixelcraftwebdesign.com does not resolve to an IP address. How is your DNS configured? –  Shane Madden Mar 22 '12 at 5:14
    
Not sure. What do you need to know? –  Kevin Brown Mar 22 '12 at 15:41
show 10 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.