Use ServerName as my domain.com and make use of ProxyPass and ProxyPassReverse directive to redirect /railsapp to desired location.... Read more about reverse proxy..