I have multiple Rails apps running on my Bitnami Rubystack (2.0.0-17 Windows).
myapp1 on port 3001
myapp2 on port 3002
myapp3 on port 3003
I have DNS A-records pointing to my server x.x.x.x, on domain example.com with the following subdomains:
myapp1-domain.example.com
myapp2-domain.example.com
myapp3-domain.example.com
I can reach each of them with their respective portnumbers:
myapp1-domain.example.com:3001
How can I configure Apache to accept requests at port 80 and route them to the localport? Now I have to create new firewall rules for every app.
After some digging, I found something similar that just nails it. Is it a duplicate? No. I found obscure tutorials, even bad links on the Apache doc section. So, for everyone who really doesn't care about Apache, but just wants their Rails apps to fly with reverse proxy:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "YOUR_BITNAMI_INSTALL_DIR/rubystack-2.0.0-17/projects/dummy/public"
ServerName your-subdomain.domain.com
ProxyPass / http://localhost:3001/
ProxyPassReverse / http://localhost:3001/
</VirtualHost>
Does the trick perfectly!