skip to Main Content

I have a docker container running Jupyter notebook on port 8000 on a RHEL 7 server, and when I access it over http://server-name:8000, it seems to be perfectly fine.

However, when I tried to configure ssl certs on apache web server, content is not being served on https

my config file is like below.

Listen 443 https
<VirtualHost *:443>  
    ServerName server.com
    SSLEngine on
    SSLCertificateFile /path/to/cerfile.cer
    SSLCertificateKeyFile /path/to/Keyfile.key
    ProxyPass / https://server.com:8000/tree
    ProxyPassReverse / https://server.com/8000/tree                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
</VirtualHost>

I am not able to access https://server.com:8000/tree individually,
however i am able to access http://server.com:8000/tree

And its not that my certificates are not working, I am able to access https://server.com when I remove ProxyPass in above config.

<VirtualHost *:443>  
    ServerName server.com
    SSLEngine on
    SSLCertificateFile /path/to/cerfile.cer
    SSLCertificateKeyFile /path/to/Keyfile.key                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
</VirtualHost>

I am not sure of why my content is not loading under https, can someone explain me this?

Error receiving when trying to reach https://server-name:8000/tree

This site can’t be reached server-name took too long to
respond. Try:

Checking the connection Checking the proxy and the firewall
ERR_TIMED_OUT

2

Answers


  1. Chosen as BEST ANSWER

    This did the trick, Seems like Jupyter has standard proxying config. Reference:

    ProxyPreserveHost On
    ProxyPass /api/kernels/ ws://server:8000/api/kernels/
    ProxyPassReverse /api/kernels https://server:8000/api/kernels/
    ProxyPass / https://server:8000/
    ProxyPassReverse / https://server:8000/
    

  2. As per your conf your reverse proxy is listening on port 443 not on 8080 that’s why you are not able to access the app via 8080 when proxypass is there. if you want access the app via https for port 8080 try the below conf:

    <VirtualHost *:8000>  
        ServerName server.com
        SSLEngine on
        SSLCertificateFile /path/to/cerfile.cer
        SSLCertificateKeyFile /path/to/Keyfile.key
        ProxyPass / https://server.com:8000/tree
        ProxyPassReverse / https://server.com/8000/tree                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
    </VirtualHost>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search