diff --git a/en/mapfile/config.txt b/en/mapfile/config.txt index 6e7a4af864..0668aff016 100644 --- a/en/mapfile/config.txt +++ b/en/mapfile/config.txt @@ -65,6 +65,9 @@ ENV the Web server. MapServer will fall back to the environment variables if they exist for any of the :ref:`MS* variables`. + MapServer 8.8 introduces the :ref:`ms_onlineresource` setting, which allows the external root URL + to be defined in the CONFIG file and applied to all Mapfiles in a deployment. + .. index:: pair: CONFIG; MAPS :name: mapfile-config-maps @@ -151,6 +154,7 @@ A full sample config file is shown below: # MS_MAPFILE_PATTERN "\.map$" # MS_XMLMAPFILE_XSLT "/path/to/mapfile.xsl" # MS_MODE "BROWSE" # default mode for CGI calls + # MS_ONLINERESOURCE "https://maps.example.com/" # used as a base URL for building OWS URLs when not specified in the Mapfile # MS_OPENLAYERS_CSS_URL "//mapserver.org/lib/10.4.0/ol-mapserver.css" # default value # MS_OPENLAYERS_JS_URL "//mapserver.org/lib/10.4.0/ol-mapserver.js" # default value # MS_TEMPPATH "/tmp" diff --git a/en/ogc/wfs_server.txt b/en/ogc/wfs_server.txt index 2fabe38948..c2a13ff721 100644 --- a/en/ogc/wfs_server.txt +++ b/en/ogc/wfs_server.txt @@ -124,6 +124,12 @@ layers that meet the following conditions: shouldn't count on that too much. It is strongly recommended that you provide the wfs_onlineresource metadata. + As of MapServer 8.8, the new :ref:`ms_onlineresource` environment variable can be defined in the CONFIG file + to provide a global fallback online resource URL for all services, including WFS. + This is useful when multiple Mapfiles are deployed and you want to avoid setting the URL in each one. + Service-specific metadata (for example, ``wfs_onlineresource``) takes precedence if both are defined. + + See section 12.3.3 of the `WFS 1.0.0 specification`_ for the whole story about the online resource URL. Basically, what you need is a complete HTTP URL including the http:// prefix, hostname, script diff --git a/en/ogc/wms_server.txt b/en/ogc/wms_server.txt index 1a36eabf31..43450e6cc1 100644 --- a/en/ogc/wms_server.txt +++ b/en/ogc/wms_server.txt @@ -150,6 +150,8 @@ Example 2. On Windows: .. index:: pair: WMS Server; Mapfile +.. _wms_mapfile_setup: + Setup a Mapfile For Your WMS ---------------------------- @@ -306,6 +308,11 @@ Let's go through each of these parameters in more detail: shouldn't count on that too much. It is strongly recommended that you provide the wms_onlineresource metadata. + As of MapServer 8.8, the new :ref:`ms_onlineresource` environment variable can be defined in the CONFIG file + to provide a global fallback online resource URL for all services, including WMS. + This is useful when multiple Mapfiles are deployed and you want to avoid setting the URL in each one. + Service-specific metadata (for example, ``wms_onlineresource``) takes precedence if both are defined. + See section 6.2.2 of the `WMS 1.1.1 specification`_ for the whole story about the online resource URL. Basically, what you need is a complete HTTP URL including the http:// prefix, hostname, script diff --git a/en/optimization/environment_variables.txt b/en/optimization/environment_variables.txt index 6b9919f0e0..5f85eb6a7b 100644 --- a/en/optimization/environment_variables.txt +++ b/en/optimization/environment_variables.txt @@ -342,6 +342,29 @@ MS_MODE .. index:: pair: Environment variables; MS_OPENLAYERS_JS_URL +.. _ms_onlineresource: + +MS_ONLINERESOURCE + .. versionadded:: 8.8 + + Defines the root URL used by MapServer to construct all external service URLs. + This can only be set in the MapServer :ref:`config` file and cannot + be used inside individual Mapfiles. + + ``MS_ONLINERESOURCE`` can replace the need to set the + ``ows_onlineresource`` metadata in each Mapfile, providing a single + location to manage the base URL for all services in a deployment. + + This is especially useful when working with many Mapfiles, or when + the base URL differs between environments (for example, development + and production). + + For additional details, see :ref:`rfc141` and the + section on ``wms_onlineresource`` metadata in :ref:`wms_mapfile_setup`. + +.. index:: + pair: Environment variables; MS_ONLINERESOURCE + MS_OPENLAYERS_CSS_URL The URL to the OpenLayers CSS file used for styling the :ref:`openlayers`. for instance::