Is it possible to rewrite URLs?
RicoHoff opened this issue · 4 comments
Hello,
I would like to use the image with docker-commpose.yml and rewrite the URLs so that I can specify the filename of the map in the path (without path and .map).
default:
http://your.mapserver.host/?map=/etc/mapserver/mapfile.map&service=WMS&request=GetCapabilities
requested:
http://your.mapserver.host/map/mapfile?service=WMS&request=GetCapabilities
The rewrite module is apparently not enabled by default in the image and my attempts to do so have unfortunately failed so far.
Is there an easy way to enable this via config? And if this works, do I additionally need to change something in the MS_MAP_PATTERN environment variable so that I don't get an error due to missing map parameter?
For that, you can use the MS_MAPFILE
environment variable :-)
Yes - as long as I have only one mapfile, right? However, I am looking for a solution for different mapfiles. All mapfiles are in the same folder.
http://your.mapserver.host/map/mapfile1?service=WMS&request=GetCapabilities
http://your.mapserver.host/map/mapfile2?service=WMS&request=GetCapabilities
http://your.mapserver.host/map/mapfile3?service=WMS&request=GetCapabilities
and so on
With MapServer 8.0 there is a file to do a mapping:
https://github.com/camptocamp/docker-mapserver/blob/master/acceptance_tests/config/mapserver/landingpage.conf#L2-L4
Did you try that?
Doc: https://mapserver.org/mapfile/config.html
no, but I will be happy to take a look
thanks first for the tip - i'll get back to you :-)