Page 1 of 1

apache proxypass question - service unavailable

Posted: 2017/02/23 18:37:29
by mcheoti
Hi everybody, i have a quick question and maybe you can answer this.
I have Apache/2.4.6 (CentOS) running and some applications. I have an appliacation running on port 1880.
I am able the access the app under http://localhost:1880/ works.

I implemented a Proxy pass in the httpd restarted the service and the application but when I try to access
http://localhost/ch/ I got the error message

Code: Select all

Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
I am sure this is a config issue, because I can access the application wirh http://localhost:1880/ ,
Here is the Virtual Host from my httpd.conf

Code: Select all

<VirtualHost *:80>
ServerName 127.0.0.1
<IfModule mod_proxy.c>
  ProxyPass /ch/ http://127.0.0.1:1880/ retry=0 timeout=5
  ProxyPassReverse /ch/ http://127.0.0.1:1880/
</ifModule>
</VirtualHost>
I used the Apache Doc, but maybe I missed something. Any ideas ?
https://httpd.apache.org/docs/2.4/mod/mod_proxy.html

All the best

Re: apache proxypass question - service unavailable

Posted: 2017/02/23 18:46:25
by TrevorH
Do you have entries in your apache logs for this? If you didn't specify a log file then most likely in /var/log/httpd/error_log

Re: apache proxypass question - service unavailable

Posted: 2017/02/24 07:05:24
by larwood
Do you have SELinux enabled? Check your SELinux logs.

You may need to enable the port:

Code: Select all

semanage port -a -t http_port_t -p tcp 1880
Or you can enable the boolean so httpd can connect to the network

Code: Select all

setsebool -P httpd_can_network_connect on

Re: apache proxypass question - service unavailable

Posted: 2017/03/11 09:35:11
by mcheoti
Hi All,

i found a solution.
This is the working configuration with a websocket. As example when you want to do that with Node Red

Code: Select all

<VirtualHost *:80>
  ServerName 127.0.0.1
 <IfModule mod_proxy.c>
  ProxyPass "/nr/comms"  "ws://localhost:1880/comms"
  ProxyPass /nr/ http://127.0.0.1:1880/ retry=0 timeout=5
  ProxyPassReverse /nr/ http://127.0.0.1:1880/
</ifModule>
</VirtualHost>