2

I'm running Geoserver over HTTPS and when I preview a layer with openlayers3 format the page throws an error.

The error point that some resources

i.e. http://mydomain.com/geoserver/openlayers3/ol.js

are blocked because are requested over HTTP.

enter image description here


I tried to change it manually but I can't find the file.

Is there some configuration file I need to change so that the page request the content over HTTPS?

  • 1
    Are you saying you are using OpenLayers as an output format from a GeoServer service, or have an OpenLayers client already, and are trying to consume an HTTPS service from GeoServer? – nmtoken May 11 '18 at 12:18
  • Sorry if It was unclear. Is the own Geoserver's LayerPreview Page (selecting openlayers from the dropdown output format) which request those resources over HTTP. Using WMS or other services in my own openlayers client works great. It's just the LayerPreview Page. – Jose Hermosilla Rodrigo May 11 '18 at 13:11
  • what if you use openlayers.org/en/v4.6.5/build/ol.js for a test? – Mapperz May 11 '18 at 14:22
  • 2
    Layer preview is really only designed to work from localhost. Feel free to open a PR with a fix though – Ian Turton May 13 '18 at 15:42
  • 1
    @IanTurton The Geoserver team should really fix this! The protocol part of the request url should not default to http but rather use whatever protocol the preview page is accessed on. – Ries Sep 27 '18 at 8:50
2

Setting Proxy Base URL in global settings worked for me.

http://docs.geoserver.org/stable/en/user/configuration/globalsettings.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.