Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 58 additions & 6 deletions en/development/rfc/ms-rfc-141.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MS RFC 141: MapServer CONFIG MS_ONLINERESOURCE

:Author: Seth Girvin
:Contact: sethg@geographika.co.uk
:Last Updated: 2026-02-06
:Last Updated: 2026-02-13
:Version: MapServer 8.8
:Status: Proposed

Expand Down Expand Up @@ -114,12 +114,44 @@ Users will be able to add the new environment variable to the ``CONFIG`` file as

CONFIG
ENV
MS_ONLINERESOURCE "http://localhost/test/"
MS_ONLINERESOURCE "https://maps.example.com/"
END
MAPS
EXAMPLE "/data/mapfiles/example.map"
END
END

When accessing the Mapfile using its key (``EXAMPLE`` in the above example), a request
such as https://maps.example.com/example/?service=wms&version=1.3.0&request=GetCapabilities will return a
GetCapabilities response with the base URL set to ``https://maps.example.com/``.

.. code-block:: xml

<WMS_Capabilities>
<Service>
<Name>WMS</Name>
<Title>Example</Title>
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://maps.example.com/example/?"/>

When accessing a Mapfile using the ``&map=`` parameter, this will be appended to the ``MS_ONLINERESOURCE`` URL.
For example, a request to https://maps.example.com/?map=/data/mapfiles/example.map&service=wms&version=1.3.0&request=GetCapabilities
will return a GetCapabilities response including the following:

.. code-block:: xml

<HTTP>
<Get>
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://maps.example.com/?map=/data/mapfiles/example.map&"/>
</Get>

For OGC API URLs requests such as https://maps.example.com/example/ogcapi/?f=json will return URLs in
the format https://maps.example.com/example/ogcapi/collections?f=html.

Notes:

- Existing ``*_onlineresource`` metadata in a Mapfile will take precedence over
the ``CONFIG`` setting.
- In any of the above examples, if the ``example.map`` contained ``ows_onlineresource``
(or a more specific variant such as ``wms_onlineresource`` or ``oga_onlineresource``)
then these would take precedence over the ``CONFIG`` setting and be used instead.

- If ``MS_ONLINERESOURCE`` is set to an empty string, the resulting base URL
will be empty. Users are responsible for providing a valid URL for their
Expand All @@ -130,6 +162,21 @@ Notes:
multiple variables such as ``MS_WMS_ONLINERESOURCE`` or
``MS_WFS_ONLINERESOURCE`` would add unnecessary complexity.

- ``?`` will be appended to the end of the URL for building OWS URLs, to ensure that query parameters are appended correctly.

- MAP keys are resolved relative to MS_ONLINERESOURCE, and only one root URL can be configured per CGI instance.
For example, you cannot simultaneously use:

+ https://maps.example.com/dev/example/
+ https://maps.example.com/prod/example/

or separate hostnames such as:

+ https://wms.example.com
+ https://wfs.example.com

To support these scenarios, you would need to deploy separate MapServer CGI applications with different CONFIG files.

Testing
-------

Expand All @@ -138,6 +185,7 @@ and Mapfile setups, including:

- Cases with and without a ``MS_ONLINERESOURCE`` setting
- The case where ``MS_ONLINERESOURCE`` is set to an empty string
- Use of ``map=`` parameter in requests

Security Concerns
-----------------
Expand Down Expand Up @@ -169,12 +217,16 @@ Affected files
Ticket Reference
----------------

TODO
+ https://github.com/MapServer/MapServer/pull/7434

Documentation
-------------

TODO

Voting History
--------------

TODO
+1 from PSC members TomK, SethG, MikeS, DanielM, JeromeB, SteveL, EvenR, JeffM, JukkaR

See https://lists.osgeo.org/pipermail/mapserver-dev/2026-February/017342.html for discussion and voting.