Skip to content

Commit 699a451

Browse files
author
MapServer deploybot
committed
update with results of commit MapServer/MapServer-documentation@445c9ba
1 parent 16bd78e commit 699a451

519 files changed

Lines changed: 1077 additions & 523 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

MIGRATION_GUIDE.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,7 @@ <h3>Navigation</h3>
15641564
</div>
15651565
<div class="footer" role="contentinfo">
15661566
&#169; <a href="copyright.html">Copyright</a> 2026, Open Source Geospatial Foundation.
1567-
Last updated on 2026-01-14.
1567+
Last updated on 2026-02-06.
15681568
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 9.1.0.
15691569
</div>
15701570
</body>

_modules/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ <h3>Navigation</h3>
159159
</div>
160160
<div class="footer" role="contentinfo">
161161
&#169; <a href="../copyright.html">Copyright</a> 2026, Open Source Geospatial Foundation.
162-
Last updated on 2026-01-14.
162+
Last updated on 2026-02-06.
163163
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 9.1.0.
164164
</div>
165165
</body>

_modules/mapscript/mapscript.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5588,7 +5588,7 @@ <h3>Navigation</h3>
55885588
</div>
55895589
<div class="footer" role="contentinfo">
55905590
&#169; <a href="../../copyright.html">Copyright</a> 2026, Open Source Geospatial Foundation.
5591-
Last updated on 2026-01-14.
5591+
Last updated on 2026-02-06.
55925592
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 9.1.0.
55935593
</div>
55945594
</body>

_sources/development/rfc/index.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,4 @@ the project.
152152
ms-rfc-138
153153
ms-rfc-139
154154
ms-rfc-140
155+
ms-rfc-141
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
.. _rfc141:
2+
3+
================================================
4+
MS RFC 141: MapServer CONFIG MS_ONLINERESOURCE
5+
================================================
6+
7+
:Author: Seth Girvin
8+
:Contact: sethg@geographika.co.uk
9+
:Last Updated: 2026-02-06
10+
:Version: MapServer 8.8
11+
:Status: Proposed
12+
13+
Overview
14+
--------
15+
16+
This RFC proposes adding a new environment variable, ``MS_ONLINERESOURCE``, to
17+
the MapServer :ref:`CONFIG file <config>`.
18+
19+
The variable acts as a global fallback when no service-specific
20+
``*_onlineresource`` metadata (defined in the Mapfile
21+
:ref:`mapfile-web-metadata`) is provided. For background on service-specific
22+
usage, see :ref:`online_resource_wms`.
23+
24+
The ``*_onlineresource`` settings define the public-facing URLs that MapServer
25+
advertises in GetCapabilities and related responses for accessing its OGC
26+
services (WMS, WFS, WCS, OGC Features API, etc.). These URLs are consumed by clients and must resolve correctly.
27+
28+
Introducing a global ``MS_ONLINERESOURCE`` addresses the following issues:
29+
30+
1. Mapfiles currently require service-specific ``*_onlineresource`` values,
31+
or an ``ows_onlineresource`` to be modified for each deployment environment
32+
(for example, local development, staging, and production).
33+
This RFC allows these environment-specific settings
34+
to be defined once in a single ``CONFIG`` file.
35+
36+
2. When a Mapfile does not define ``*_onlineresource`` metadata, MapServer
37+
attempts to construct the service URL from request headers and server
38+
variables. This approach can produce incorrect or inconsistent URLs in more
39+
complex deployments, particularly when reverse proxies are used. As a
40+
result, explicitly defining ``*_onlineresource`` metadata is currently
41+
strongly recommended.
42+
43+
Current Implementation
44+
----------------------
45+
46+
When a Mapfile does not define ``*_onlineresource`` metadata, MapServer uses
47+
the ``msBuildOnlineResource()`` function (in ``maputil.c``) to construct the
48+
base **online resource URL**.
49+
50+
The URL is generated dynamically from CGI request data and server environment
51+
variables, and relies on CGI and proxy headers; this can produce incorrect
52+
results in some server or reverse-proxy configurations.
53+
54+
The function determines the URL components as follows:
55+
56+
- **Hostname**
57+
58+
- Uses ``HTTP_X_FORWARDED_HOST`` if present
59+
- Falls back to ``SERVER_NAME``
60+
- If multiple forwarded hosts are provided, only the first is used
61+
62+
- **Port**
63+
64+
- Uses ``HTTP_X_FORWARDED_PORT`` if present
65+
- Otherwise uses ``SERVER_PORT``
66+
67+
- **Protocol**
68+
69+
- Defaults to ``http``
70+
- Uses ``https`` if ``HTTPS=on`` or ``SERVER_PORT=443``
71+
- ``HTTP_X_FORWARDED_PROTO`` overrides all other logic
72+
73+
- **Path**
74+
75+
- Uses ``SCRIPT_NAME``
76+
- Appends ``PATH_INFO`` if present
77+
78+
- **Query parameters**
79+
80+
- If the request is a GET request and includes a ``map=`` parameter, it is
81+
appended as ``map=...&``
82+
83+
The port is omitted when it matches the protocol default (``80`` for HTTP,
84+
``443`` for HTTPS); otherwise it is included explicitly.
85+
86+
The resulting URL has the general form:
87+
88+
::
89+
90+
[protocol]://[hostname][:port][script][pathinfo]?[map=...&]
91+
92+
Examples:
93+
94+
::
95+
96+
https://maps.example.com/mapserv?
97+
https://maps.example.com/mapserv/ogc?map=/data/example.map&
98+
http://localhost:8080/cgi-bin/mapserv?
99+
100+
If the hostname, port, or script name cannot be determined, the function
101+
fails with a CGI error:
102+
103+
::
104+
105+
Impossible to establish server URL.
106+
107+
108+
Proposed Implementation
109+
-----------------------
110+
111+
Users will be able to add the new environment variable to the ``CONFIG`` file as follows:
112+
113+
::
114+
115+
CONFIG
116+
ENV
117+
MS_ONLINERESOURCE "http://localhost/test/"
118+
119+
Notes:
120+
121+
- Existing ``*_onlineresource`` metadata in a Mapfile will take precedence over
122+
the ``CONFIG`` setting.
123+
124+
- If ``MS_ONLINERESOURCE`` is set to an empty string, the resulting base URL
125+
will be empty. Users are responsible for providing a valid URL for their
126+
environment.
127+
128+
- There are no plans to support separate ``MS_ONLINERESOURCE`` values for
129+
different services. While this could be useful in some scenarios, having
130+
multiple variables such as ``MS_WMS_ONLINERESOURCE`` or
131+
``MS_WFS_ONLINERESOURCE`` would add unnecessary complexity.
132+
133+
Testing
134+
-------
135+
136+
The ``msautotests`` test suite will be updated to validate various ``CONFIG``
137+
and Mapfile setups, including:
138+
139+
- Cases with and without a ``MS_ONLINERESOURCE`` setting
140+
- The case where ``MS_ONLINERESOURCE`` is set to an empty string
141+
142+
Security Concerns
143+
-----------------
144+
145+
There are no known security concerns at the moment.
146+
147+
MapScript
148+
---------
149+
150+
MapScript already supports ``CONFIG`` files, so no changes are required.
151+
152+
Example usage:
153+
154+
::
155+
156+
# Create a new map object with a CONFIG file
157+
config = mapscript.configObj(r"C:\MapServer\apps\mapserver.conf")
158+
map = mapscript.mapObj(r"C:\MapServer\my.map", config)
159+
160+
# The CONFIG file can also be passed to the fromstring helper method
161+
mapscript.fromstring("MAP NAME TEST END", r"C:/MapfileResources/", config_file)
162+
163+
164+
Affected files
165+
--------------
166+
167+
+ ``maputil.c``
168+
169+
Ticket Reference
170+
----------------
171+
172+
TODO
173+
174+
Documentation
175+
-------------
176+
177+
Voting History
178+
--------------
179+
180+
TODO

about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ <h3>Navigation</h3>
244244
</div>
245245
<div class="footer" role="contentinfo">
246246
&#169; <a href="copyright.html">Copyright</a> 2026, Open Source Geospatial Foundation.
247-
Last updated on 2026-01-14.
247+
Last updated on 2026-02-06.
248248
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 9.1.0.
249249
</div>
250250
</body>

announcements/2021-03-30-limit-mapfile-access.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ <h3>Navigation</h3>
183183
</div>
184184
<div class="footer" role="contentinfo">
185185
&#169; <a href="../copyright.html">Copyright</a> 2026, Open Source Geospatial Foundation.
186-
Last updated on 2026-01-14.
186+
Last updated on 2026-02-06.
187187
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 9.1.0.
188188
</div>
189189
</body>

announcements/2021-06-11-community-condolences.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ <h3>Navigation</h3>
195195
</div>
196196
<div class="footer" role="contentinfo">
197197
&#169; <a href="../copyright.html">Copyright</a> 2026, Open Source Geospatial Foundation.
198-
Last updated on 2026-01-14.
198+
Last updated on 2026-02-06.
199199
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 9.1.0.
200200
</div>
201201
</body>

announcements/announcements_archive.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ <h3>Navigation</h3>
687687
</div>
688688
<div class="footer" role="contentinfo">
689689
&#169; <a href="../copyright.html">Copyright</a> 2026, Open Source Geospatial Foundation.
690-
Last updated on 2026-01-14.
690+
Last updated on 2026-02-06.
691691
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 9.1.0.
692692
</div>
693693
</body>

announcements/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ <h3>Navigation</h3>
168168
</div>
169169
<div class="footer" role="contentinfo">
170170
&#169; <a href="../copyright.html">Copyright</a> 2026, Open Source Geospatial Foundation.
171-
Last updated on 2026-01-14.
171+
Last updated on 2026-02-06.
172172
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 9.1.0.
173173
</div>
174174
</body>

0 commit comments

Comments
 (0)