502 Bad Gateway

ISOS6

Verified User
Joined
May 7, 2009
Messages
318
Location
Erbil, Tarin Hills, Iraq
Hello,

I suddenly get an error without some things have been changed for very long. Everything worked for a few days ago.

I am running the control panel via SSL and proxy pass.

My configurations are as follows
Code:
<VirtualHost [B]DEDICATED IP[/B]:443>

   SSLEngine on
   SSLCertificateFile /usr/local/directadmin/data/users/cpanel/domains/cpanel.domain.com.cert
   SSLCertificateKeyFile /usr/local/directadmin/data/users/cpanel/domains/cpanel.domain.com.key
   SSLCACertificateFile /usr/local/directadmin/data/users/cpanel/domains/cpanel.domain.com.cacert

    SSLProxyEngine On
    ServerName cpanel.domain.com
    ProxyPass / https://cpanel.domain.com:2222/
    ProxyPassReverse / https://cpanel.domain.com:2222/

</VirtualHost>

As said, the link worked until a day ago with the same configurations. I have not updated anything. What can be wrong? I've been everywhere on Google. Certificate is valid when I run alone without Proxy domain, so there's nothing wrong with the certificate

Apache Error log
Code:
[Sat Apr 14 00:22:53 2012] [error] (502)Unknown error 502: proxy: pass request body failed to [B]DEDICATED IP[/B]:2222 (cpanel.domain.com)
[Sat Apr 14 00:22:53 2012] [error] proxy: pass request body failed to [B]DEDICATED IP[/B]:2222 (cpanel.domain.com) from [B]MY IP [/B]()
 
Hello,

Try to set

Code:
ssl_port=2222
port=2221

in /usr/local/directadmin/conf/directadmin.conf

and make Apache to proxy to port 2221 (non-SSL).
 
What do you men in Apache? Modified here /usr/local/directadmin/data/users/USERNAME/httpd.cong
But still the same.

Modifed LogLevel warn to LogLevel info in etc/httpd/conf/...

Here is log, what does this mean?
Code:
[Sat Apr 14 13:59:37 2012] [info] [client 000.000.000.000] Connection closed to child 5 with standard shutdown (server cpanel.domain.com:443)
[Sat Apr 14 13:59:38 2012] [info] [client 000.000.000.000] (70007)The timeout specified has expired: SSL input filter read failed.
[Sat Apr 14 13:59:38 2012] [info] [client 000.000.000.000] Connection closed to child 0 with standard shutdown (server cpanel.domain.com:443)
[Sat Apr 14 13:59:40 2012] [info] [client ::1] Connection to child 6 established (server [url]www.example.com:443[/url])
[Sat Apr 14 13:59:40 2012] [info] Seeding PRNG with 144 bytes of entropy
[Sat Apr 14 13:59:40 2012] [info] [client ::1] SSL library error 1 in handshake (server [url]www.example.com:443[/url])
[Sat Apr 14 13:59:40 2012] [info] SSL Library Error: 336027900 error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol speaking not SSL to HTTPS port!?
[Sat Apr 14 13:59:40 2012] [info] [client ::1] Connection closed to child 6 with abortive shutdown (server [url]www.example.com:443[/url])
[Sat Apr 14 13:59:41 2012] [info] [client ::1] Connection to child 3 established (server [url]www.example.com:443[/url])]
 
The problem is solved! I had to change

Code:
	SSLProxyEngine On
	ProxyPass / https://cpanel.domain.com:2222/
	ProxyPassReverse / https://cpanel.domain.com:2222/

To

Code:
	SSLProxyEngine On
	ProxyPass / https://localhost:2222/
	ProxyPassReverse / https://localhost:2222/

Still do not know why, but that worked. It has worked with the same configuration all the time. But however..

Thanks zEitEr for your reply.
 
You should check to be sure that cpanel.domain.com points to the proper place.

Jeff
 
You should check to be sure that cpanel.domain.com points to the proper place.

Jeff

Yes, it points to proper place, and it worked with the same configuration for a long period, I have not touched anything or updatd server. Suddenly I got a message from a user where he said the link did not work. I still do not know what is the error. However, fixed by changing the domain to localhost. :cool:
 
Back
Top