apacheproxygeoservermixed-content

Use HTTP Geoserver Layer with my HTTPS website, Error Mixed Content


I just installed my HTTPS certificate on my website. As I call HTTP geoserver links, I have this error:

The page at 'https://mywebsite/joomla/index.php/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://mywebsite:8080/geoserver/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=WebPortal%3AAlert_province_boundary&maxFeatures=50&outputFormat=application%2Fjson'. This request has been blocked; the content must be served over HTTPS.

I can't access to my geoserver portal with HTTPS (only http link works: http://mywebsite:8080/geoserver/).

As I understand, my HTTPS certificate doesn't cover my geoserver portal because it's working on the 8080 port.

How to do to make my HTTPS certificate cover my geoserver web portal ?

Try:

  1. I try to configure an apache proxy but it's not working:

Adding of these lines in /etc/apache2/sites-available/000-default.conf:

ProxyPreserveHost On

ProxyPass "/geoserver" "http://localhost:8080/geoserver"

ProxyPassReverse "/geoserver" "http://localhost:8080/geoserver"

  1. I saw to Geoserver has Proxy Base URL. I read the documentation (https://docs.geoserver.org/latest/en/user/configuration/globalsettings.html#proxy-base-url), I don't understand anything, the documentation is not clear for me.

Solution

  • This command solve my problem: sudo a2enmod proxy proxy_http proxy_ajp