Hi Anders,

Maybe you can do a simple fix by defining "Proxy based URL". Go to
Settings → Global and set "Proxy based URL" to your domain, with or
without the port. Test it.


Regards,


Jorge Gustavo


Às 20:19 de 11/03/19, Anders Olsen escreveu:
> Hello!
>
> I am currently using GeoServer 2.15.0 through a Tomcat running on port
> 8080.
> To control which webapps are available on my various domains, I run a
> reverse proxy with Apache in front on port 80, using a normal
> ProxyPass & ProxyPassReverse
> I also have SSL setup, so in short, my setup is like this:
>
> https://example.com/geoserver -> http://example.com:8080/geoserver (I
> have substituted my real domain with an example)
>
> I want to test my newest layer, so I go into Layer Preview ->
> OpenLayers and it opens a URL like this:
> https://example.com/geoserver/dof/wms?service=WMS&version=1.1.0&request=GetMap&layers=dof%3AREGIONER&bbox=441548.9689738757%2C6049494.406376901%2C893480.0854518213%2C6402159.588024116&width=768&height=599&srs=EPSG%3A23032&format=application/openlayers
>
> However, this returns a white map!
>
> In the console, I see the following (I've translated it but hopefully
> it still makes sense):
>     Blocked mixed content
> "http://example.com/geoserver/openlayers3/ol.css";
>     Blocked mixed content "http://example.com/geoserver/openlayers3/ol.js";
>     Blocked mixed content
> "http://example.com/geoserver/openlayers3/ol.css";
>     Blocked mixed content "http://example.com/geoserver/openlayers3/ol.js";
>     Loading failed for  <script> with source
> "http://example.com/geoserver/openlayers3/ol.js";
>     ReferenceError: ol is not defined
>
>
> When I look at the source, I see that the wrong URL is used:
>
>     <link rel="stylesheet"
> href="http://example.com:80/geoserver/openlayers3/ol.css"; type="text/css">
>     <script src="http://example.com:80/geoserver/openlayers3/ol.js";
> type="text/javascript"></script>
>
> From what I can find in the code,
> org/geoserver/wms/map/AbstractOpenLayersMapOutputFormat.java:134 uses
> this as the baseUrl for the template:
>             String baseUrl =
>                     ResponseUtils.buildURL(request.getBaseUrl(), "/",
> null, URLType.RESOURCE);
>
>
> The code is a bit too complex for me to create a fix, since I am not
> sure what ramifications my changes might have, but my guess would be
> that for the AbstractOpenLayersMapOutputFormat, either the base proxy
> url from the GeoServer settings or all X-Forwarded type of headers
> should be considered.
>
> Med venlig hilsen / With regards
>
>
> ANDERS OLSEN
> Software Developer
> BirdLife Denmark
>
>
> _______________________________________________
> Geoserver-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
-- 
Logo*   Geomaster, LDA*
  *VENHA DESCOBRIR O CAMINHO DO OPEN SOURCE CONNOSC**O

*
 
Avenida Barros e Soares
N.º 423, 4715-214 Braga
VAT/NIF510 906 109
Phone  +351 253 680 323
Site       geomaster.pt <http://geomaster.pt>
GPS       41.53322, -8.41929
        
------------------------------------------------------------------------
         
Jorge Gustavo Rocha
CTO

Mobile  +351 910 333 888
Email    [email protected]


_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to