<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML-esimuotoiltu Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTML-esimuotoiltuChar
        {mso-style-name:"HTML-esimuotoiltu Char";
        mso-style-priority:99;
        mso-style-link:HTML-esimuotoiltu;
        font-family:Consolas;}
span.Shkpostityyli22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 70.85pt 2.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FI" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">I am not sure how well redirect plays together with MS_MAP_PATTERN
<a href="https://www.mapserver.org/optimization/limit_mapfile_access.html#limit-mapfile-access">
https://www.mapserver.org/optimization/limit_mapfile_access.html#limit-mapfile-access</a> but maybe you could test it by redirecting locally and trying to access a mapfile from a directory that does not match with MS_MAP_PATTERN. If that requires Apache admin
 rights then maybe it does not bring back <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-32062">
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-32062</a>.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">If having mapfiles in s3 feels like an option that Mapserver should support then perhaps RFC 56
<a href="https://www.mapserver.org/development/rfc/ms-rfc-56.html#rfc56">https://www.mapserver.org/development/rfc/ms-rfc-56.html#rfc56</a> should be reviewed.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">-Jukka Rahkonen-<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>Lähettäjä:</b> MapServer-users <mapserver-users-bounces@lists.osgeo.org>
<b>Puolesta </b>Marcin Niemyjski via MapServer-users<br>
<b>Lähetetty:</b> maanantai 24. lokakuuta 2022 12.13<br>
<b>Vastaanottaja:</b> Marcin Niemyjski via MapServer-users <mapserver-users@lists.osgeo.org><br>
<b>Aihe:</b> [MapServer-users] Redirecting to s3 via apache2 redirect/alias/proxy<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">Hello,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">coming back to you with one more question about s3, namely:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">As I wrote before - I want to keep my mapfiles on buckets but I also want to access them without need to mount buckets to VMs, so I've came up with this:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black"><a href="https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fhttpd.apache.org%2Fdocs%2F2.4%2Frewrite%2Fflags.html%23flag_p&data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7Ca7ec15f2a9c3426f8cfb08dab59ff396%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C0%7C638021995838914540%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=hGkMIdjG9pqN7fHVr%2FM9iJLLB%2F4ooFHD2trkQO8v5RI%3D&reserved=0">https://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_p</a><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black"><a href="https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmapserver.org%2Fogc%2Fwms_server.html%23changing-the-online-resource-url&data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7Ca7ec15f2a9c3426f8cfb08dab59ff396%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C0%7C638021995839070775%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=0F26wO0I%2FjPGEPRMNuXY82PtHZ3a7M7TWfF0YBQmKCI%3D&reserved=0">https://mapserver.org/ogc/wms_server.html#changing-the-online-resource-url</a><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">generaly I want to do this:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">ProxyPass        /martest/
<a href="https://s3.amazon.com/Bucket/Key">https://s3.amazon.com/Bucket/Key</a><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">ProxyPassReverse /martest/
<a href="https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fs3.amazon.com%2FBucket%2FKey&data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7Ca7ec15f2a9c3426f8cfb08dab59ff396%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C0%7C638021995839070775%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=502pTFvV%2FC4MeUvGacEINJb%2FlJac89yQg%2BJDAiyjyu8%3D&reserved=0">
https://s3.amazon.com/Bucket/Key</a><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">or<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:black">RewriteEngine on</span><span style="font-size:12.0pt;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:black">RewriteRule /martest/
</span><span style="font-size:12.0pt;color:black"><a href="https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fs3.amazon.com%2FBucket%2F&data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7Ca7ec15f2a9c3426f8cfb08dab59ff396%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C0%7C638021995839070775%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=geyuNsQ57Xtcd%2BLw2idANpGsSQDtEgEij%2BaIDSk79B0%3D&reserved=0"><span style="font-family:"Arial",sans-serif">https://s3.amazon.com/Bucket/</span></a><o:p></o:p></span></p>
</div>
<pre style="background:white"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif;color:black">so, while using WMS online resource url <a href="https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.lpis.pl%2Fcgi-bin%2Fmapserv%3Fmap%3D%2Fmartest%2Fjrc.map&data=05%7C01%7Cjukka.rahkonen%40maanmittauslaitos.fi%7Ca7ec15f2a9c3426f8cfb08dab59ff396%7Cc4f8a63255804a1c92371d5a571b71fa%7C0%7C0%7C638021995839070775%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=EEUrf970Gf96ulDORIHKbBvjLRJjDilHvo6gi%2BL7LDI%3D&reserved=0">https://www.lpis.pl/cgi-bin/mapserv?map=/martest/jrc.map</a> i would connect to mapfile on s3.<o:p></o:p></span></pre>
<pre style="background:white"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif;color:black"><br>But it doesn't seem to be working. Is this even possible to connect mapserver and s3 this way?<br><br>As always thank you for your help and time,<br>Marcin<o:p></o:p></span></pre>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
</div>
</body>
</html>