I have a web app running on Ruby and I need to get it to load under apache. The app runs on port 5000, so I'm trying to get it working using mod_proxy but having little success.
My website is www.domain.com, and I'm trying to get the web app to load with the URL www.domain.com/status
This is what I tried with my vhost file initially:
<VirtualHost 10.0.31.110:80>
ServerName domain.com
ServerAlias www.domain.com
ServerAdmin [email protected]
DocumentRoot /var/www/website
ProxyPass /status http://127.0.0.1:5000
ProxyPassReverse / http://127.0.0.1:5000
</VirtualHost>
However this didn't work, and it just loaded my main www.domain.com website with an unknown page. So just for troubleshooting, I tried making two separate vhosts like so:
<VirtualHost 10.0.31.110:80>
ServerName domain.com
ServerAlias www.domain.com
ServerAdmin [email protected]
DocumentRoot /var/www/website
</VirtualHost>
<VirtualHost 10.0.31.110:80>
ServerName status.domain.com
ProxyPass / http://127.0.0.1:5000
ProxyPassReverse / http://127.0.0.1:5000
</VirtualHost>
Then visiting status.domain.com I get this error:
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /setup/step1.
Reason: DNS lookup failure for: 127.0.0.1:5000setup
And this is in my apache error log:
[Fri Dec 30 19:45:14.826803 2016] [proxy:error] [pid 20280] [client 64.92.54.xxx:24492] AH00898: DNS lookup failure for: 127.0.0.1:5000favicon.ico returned by /favicon.ico, referer: http://status.domain.com/setup/step1
The Ruby site automatically forwards to the /setup/step1 URL, wouldn't think that has anything to do with it though.
I must be doing something wrong... I've never used mod_proxy before, this is a first for me, so I'm sure I'm probably missing something simple here, but can't figure it out.