Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

502 proxy Error [error reading from remote server]

I'm getting an error message with my https site. when I am working with my http site it working fine on APACHE2 on Ubuntu 14.04.

enter image description here

here is my virtual host config for https site

<VirtualHost _default_:443>
             SSLProxyEngine On
             ProxyRequests Off
             ProxyPreserveHost On
             RequestHeader set Front-End-Https "On"

            servername jenkins.mydomain.com
            Proxypass / https://192.168.0.93:8080/  Keepalive=on
            ProxypassReverse / https://jenkins.mydomain.com/


            SSLEngine on
            SSLCertificateFile      /etc/apache2/ssl/wildcard.crt
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined
    </virtualHost>

please tell me where I am doing mistake.

like image 391
Saurabh Agrawal Avatar asked Sep 06 '16 07:09

Saurabh Agrawal


Video Answer


1 Answers

I have solved my issue. I had few mistakes in my virtualhost configurations. new virtualhost configurations with ssl is below

    <VirtualHost *:443>
        SSLEngine On
        SSLCertificateFile /etc/apache2/ssl/wildcard.crt
        ServerAdmin [email protected]
        ProxyRequests Off
        ProxyPreserveHost On
        AllowEncodedSlashes NoDecode

        <Proxy *>
                Order deny,allow
                Allow from all
        </proxy>

        ServerName jenkins.mydomain.com
        ProxyPass / http://192.168.0.93:8080/ nocanon
        ProxyPassReverse / http://jenkins.mydomain.com/
        RequestHeader set X-Forwarded-Proto "https"
        RequestHeader set X-Forwarded-Port "443"

</virtualhost>
like image 83
Saurabh Agrawal Avatar answered Sep 24 '22 00:09

Saurabh Agrawal