Question

I am working on a rails app which runs on localhost:3000. I want example.com to point to localhost:3000. I edited the /etc/hosts file but it doesn't take port number so the request goes to apache. I want apache sites to work as they are but redirect example.com to rails server.

Please suggest the best way to achieve this.

Was it helpful?

Solution

Can you just specify example.com:3000 when browsing to your site? If not, I'd suggest using Phusion Passenger so that Apache can continue to respond on port 80 while also running your app.

OTHER TIPS

Use mod_proxy?

ProxyPass /your_rails_app http://your.server.address:3000
ProxyPassReverse /your_rails_app http://your.server.address:3000

http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top