<html dir="ltr"><head></head><body style="text-align:left; direction:ltr;"><div>Yves,</div><div><br></div><div>thanks for the hint - it works, but produces an ugly URL that exposes the FS-Link of the mapfile to the public:</div><div><br></div><div><ows:Get xlink:type="simple" xlink:href="<a href="https://baumkataster-test.pikobytes.de/mapserver/?map=/opt/pikobytes/mapserver/mapfile.map&" "="">https://server1.org/mapserver/?map=/opt/service/mapserver/mapfile.map&"/</a>></div><div><br></div><div>I should have mentioned that a reverse proxy runs in front of Mapserver, that adds the mapfile to the request:</div><div><br></div><div>  location /mapserver {</div><div>    # Add header for CORS requests</div><div>    add_header Access-Control-Allow-Origin *;</div><div><br></div><div>    # Load from /etc/init.d/mapserv</div><div>    fastcgi_pass 127.0.0.1:9999;</div><div><br></div><div>    # Rewrite url to hide mapfile path</div><div>    rewrite ^(/mapserver.*)?(.*)$ $1?map=/opt/service/mapserver/mapfile.map$2 break;</div><div><br></div><div>    include fastcgi_params;</div><div>    fastcgi_param SCRIPT_NAME /usr/bin/mapserv$fastcgi_script_name;</div><div>  }</div><div><br></div><div>Is there another solution that works in conjunction with my reverse proxy? Many other server products respect proxy headers and substitute the filds of the private internal URL scheme with the corresponding elements of the public URL of the caller.</div><div><br></div><div><br></div><div>- Matthias</div><div><br></div><div>Am Donnerstag, den 17.10.2019, 11:37 +0200 schrieb Yves Jacolin:</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div>Matthias,</div><div><br></div><div>Just remove the parameter will imply that MapServer will find the correct online resource.</div><div><br></div><div>Y.</div><div><br></div><div>Le jeu. 17 oct. 2019 à 11:35, Matthias Müller <<a href="mailto:matthias_mueller@tu-dresden.de">matthias_mueller@tu-dresden.de</a>> a écrit :</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div>Hi,</div><div><br></div><div>we are running WFS services with similar mapfiles on different servers.</div><div><br></div><div>Setting the "wfs_onlineresource" is straight forward, but requires a</div><div>hard coded host name:</div><div><br></div><div>First server:</div><div>  WEB</div><div>    METADATA</div><div>      "wfs_title"          "myserver"</div><div>      "wfs_onlineresource" "<a href="https://server1.org/mapserver">https://server1.org/mapserver</a>?"</div><div>      "wfs_srs"            "EPSG:4326"</div><div>      "wfs_enable_request" "*"  # necessary</div><div>    END</div><div>  END</div><div><br></div><div><br></div><div>Second server:</div><div>  WEB</div><div>    METADATA</div><div>      "wfs_title"          "myserver"</div><div>      "wfs_onlineresource" "<a href="https://server2.org/mapserver">https://server2.org/mapserver</a>?"</div><div>      "wfs_srs"            "EPSG:4326"</div><div>      "wfs_enable_request" "*"  # necessary</div><div>    END</div><div>  END</div><div><br></div><div><br></div><div>I there way to let mapserver figure out the hostname from the request</div><div>and create the appropiate links in the WFS capabilities accordingly?</div><div><br></div><div>Something like:</div><div><br></div><div>  WEB</div><div>    METADATA</div><div>      "wfs_title"          "myserver"</div><div>      "wfs_online</div><div>resource" "{request protocol and hostname}/mapserver?"</div><div>      "wfs_srs"  </div><div>          "EPSG:4326"</div><div>      "wfs_enable_request" "*"  # necessary</div><div>    END</div><div>  END</div><div><br></div><div><br></div><div>-Matthias</div><div><br></div><div>_______________________________________________</div><div>mapserver-users mailing list</div><div><a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a></div><div><a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a></div></blockquote><div><br></div><div><br></div></blockquote></body></html>