Skip to content

Commit d3611bb

Browse files
committed
Add documentation for RFC141 MS_ONLINERESOURCE
1 parent 1abde18 commit d3611bb

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed

en/mapfile/config.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ ENV
6565
the Web server. MapServer will fall back to the environment variables
6666
if they exist for any of the :ref:`MS* variables<environment_variables>`.
6767

68+
MapServer 8.8 introduces the :ref:`ms_onlineresource` setting, which allows the external root URL
69+
to be defined in the CONFIG file and applied to all Mapfiles in a deployment.
70+
6871
.. index::
6972
pair: CONFIG; MAPS
7073
:name: mapfile-config-maps
@@ -151,6 +154,7 @@ A full sample config file is shown below:
151154
# MS_MAPFILE_PATTERN "\.map$"
152155
# MS_XMLMAPFILE_XSLT "/path/to/mapfile.xsl"
153156
# MS_MODE "BROWSE" # default mode for CGI calls
157+
# MS_ONLINERESOURCE "https://maps.example.com/" # used as a base URL for building OWS URLs when not specified in the Mapfile
154158
# MS_OPENLAYERS_CSS_URL "//mapserver.org/lib/10.4.0/ol-mapserver.css" # default value
155159
# MS_OPENLAYERS_JS_URL "//mapserver.org/lib/10.4.0/ol-mapserver.js" # default value
156160
# MS_TEMPPATH "/tmp"

en/ogc/wfs_server.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ layers that meet the following conditions:
124124
shouldn't count on that too much. It is strongly recommended that
125125
you provide the wfs_onlineresource metadata.
126126

127+
As of MapServer 8.8, the new :ref:`ms_onlineresource` environment variable can be defined in the CONFIG file
128+
to provide a global fallback online resource URL for all services, including WFS.
129+
This is useful when multiple Mapfiles are deployed and you want to avoid setting the URL in each one.
130+
Service-specific metadata (for example, ``wfs_onlineresource``) takes precedence if both are defined.
131+
132+
127133
See section 12.3.3 of the `WFS 1.0.0 specification`_ for the whole
128134
story about the online resource URL. Basically, what you need is a
129135
complete HTTP URL including the http:// prefix, hostname, script

en/ogc/wms_server.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ Example 2. On Windows:
150150
.. index::
151151
pair: WMS Server; Mapfile
152152

153+
.. _wms_mapfile_setup:
154+
153155
Setup a Mapfile For Your WMS
154156
----------------------------
155157

@@ -306,6 +308,11 @@ Let's go through each of these parameters in more detail:
306308
shouldn't count on that too much. It is strongly recommended that
307309
you provide the wms_onlineresource metadata.
308310

311+
As of MapServer 8.8, the new :ref:`ms_onlineresource` environment variable can be defined in the CONFIG file
312+
to provide a global fallback online resource URL for all services, including WMS.
313+
This is useful when multiple Mapfiles are deployed and you want to avoid setting the URL in each one.
314+
Service-specific metadata (for example, ``wms_onlineresource``) takes precedence if both are defined.
315+
309316
See section 6.2.2 of the `WMS 1.1.1 specification`_ for the whole
310317
story about the online resource URL. Basically, what you need is a
311318
complete HTTP URL including the http:// prefix, hostname, script

en/optimization/environment_variables.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,29 @@ MS_MODE
342342
.. index::
343343
pair: Environment variables; MS_OPENLAYERS_JS_URL
344344

345+
.. _ms_onlineresource:
346+
347+
MS_ONLINERESOURCE
348+
.. versionadded:: 8.8
349+
350+
Defines the root URL used by MapServer to construct all external service URLs.
351+
This can only be set in the MapServer :ref:`config` file and cannot
352+
be used inside individual Mapfiles.
353+
354+
``MS_ONLINERESOURCE`` can replace the need to set the
355+
``ows_onlineresource`` metadata in each Mapfile, providing a single
356+
location to manage the base URL for all services in a deployment.
357+
358+
This is especially useful when working with many Mapfiles, or when
359+
the base URL differs between environments (for example, development
360+
and production).
361+
362+
For additional details, see :ref:`rfc141` and the
363+
section on ``wms_onlineresource`` metadata in :ref:`wms_mapfile_setup`.
364+
365+
.. index::
366+
pair: Environment variables; MS_ONLINERESOURCE
367+
345368
MS_OPENLAYERS_CSS_URL
346369
The URL to the OpenLayers CSS file used for styling the :ref:`openlayers`.
347370
for instance::

0 commit comments

Comments
 (0)