Search code examples
apachedockerhttp-redirectwebserverdocker-machine

https is not serving content even after ssl setup, but http does


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


Solution

  • 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/