[mapserver-users] mapcache behind nginx with ssl

Trygve Aspenes trygve at aspenes.priv.no
Tue Sep 28 07:21:17 PDT 2021


OK So I will answer my self then after a major hint from a mapcache 
user.

In the mapcache.xml.sample file there is a section 
https://github.com/MapServer/mapcache/blob/11f7713c5efb730a1699dfd35bbf7300b38c8e06/mapcache.xml.sample#L7-L14 
Where you can do exactly what I want.

This solves my problem


Den 2021-09-27 22:40, skrev Trygve Aspenes:
> Hi there
> 
> I have put up a mapserver behind nginx with ssl and a curl like this
> 
> curl -s
> "https://mapserver/cgi-bin/mapserv?map=/data/mapserver/map-files/mapserver-8505ad3e-f9e3-4de3-a080-8253443ac954-20210908T120432Z.map&service=WMS&request=GetCapabilities"
> | grep OnlineResource
> 
> Gives me like:
> 
>  <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:href="https://mapserver/cgi-bin/mapserv?map=/data/mapserver/map-files/mapserver-8505ad3e-f9e3-4de3-a080-8253443ac954-20210908T120432Z.map&"/>
>           <Get><OnlineResource
> xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:href="https://mapserver/cgi-bin/mapserv?map=/data/mapserver/map-files/mapserver-8505ad3e-f9e3-4de3-a080-8253443ac954-20210908T120432Z.map&"/></Get>
>           <Post><OnlineResource
> xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:href="https://mapserver/cgi-bin/mapserv?map=/data/mapserver/map-files/mapserver-8505ad3e-f9e3-4de3-a080-8253443ac954-20210908T120432Z.map&"/></Post>
>           <Get><OnlineResource
> xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:href="https://mapserver/cgi-bin/mapserv?map=/data/mapserver/map-files/mapserver-8505ad3e-f9e3-4de3-a080-8253443ac954-20210908T120432Z.map&"/></Get>
>           <Post><OnlineResource
> xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:href="https://mapserver/cgi-bin/mapserv?map=/data/mapserver/map-files/mapserver-8505ad3e-f9e3-4de3-a080-8253443ac954-20210908T120432Z.map&"/></Post>
> 
> Yeah you get the idea. Everything perfect with https in the href link. 
> Thanks!
> 
> So I put up a mapcache which I intend to put up i front of mapserver.
> When I do a similar curl like:
> 
> curl -s
> "https://mapcache/mapcache?Overview&map=/data/mapserver/map-files/mapserver-8505ad3e-f9e3-4de3-a080-8253443ac954-20210908T120432Z.map&SERVICE=WMS&REQUEST=GetCapabilities"
> | xmllint --format - | grep OnlineResource
> 
> I get:
> 
>     <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:href="http://mapcache:8090/mapcache?"/>
>               <OnlineResource
> xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:href="http://mapcache:8090/mapcache?"/>
>               <OnlineResource
> xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:href="http://mapcache:8090/mapcache?"/>
>               <OnlineResource
> xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:href="http://mapcache:8090/mapcache?"/>
> 
> I here starts the problems. If I do this in eg QGIS, QGIS are told to
> go to the http address with port 8090(mapcache is setup to run on port
> 8090 behind the scenes) which is not reachable. It should return https
> (with no specified port, ie. using standard https port) if I
> understands correctly.
> 
> And I just cant figure put why.
> 
> The configuration for the two are almost identical and I have double
> and tripple check my config.
> 
> Any idea what I should check next?
> 
> If it could be of any help I could open access to my mapcache server 
> running.
> 
> Thanks
> 
> Trygve
> 
> PS: when I test mapcache and mapserver setup locally without ssl and
> nginx in front it works fine.
> _______________________________________________
> MapServer-users mailing list
> MapServer-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users


More information about the MapServer-users mailing list