1

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 administrator@domain.com
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 administrator@domain.com
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.

  • 3
    And it was something simple, and I feel like an idiot. I just had to put a / after the 127.0.0.1:5000/ However that only fixed it by doing status.domain.com. I still haven't been able to get it working using www.domain.com/status – grdlock Dec 31 '16 at 2:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.