[qgis-qwc2] Connections to external WMS servers fails

Sandro Mani manisandro at gmail.com
Fri Jan 3 08:49:24 PST 2020


Hi Roman

For development purposes, you can use browser addons which inject 
access-control-allow-origin headers to the requests (just look for CORS 
addons).

For production purposes, if it is a service under your control, either 
have it run on the same origin as QWC2 (origin meaning protocol, domain 
and port), or have the webserver serving your WMS add appropriate 
access-control-allow-origin headers. If it not a service under your 
control, you'll have to add a proxy service in between which adds these 
headers.

You'll however generally want to read up on the topic.

Best

Sandro

On 03.01.20 12:44, Roman Meier wrote:
> Hi Sandro,
>
> Yep, seems you are right. The console issues to following:
>
> Cross-Origin Request Blocked: The Same Origin Policy disallows reading the
> remote resource at
> http://localhost:5000/?url=https%3A%2F%2Fwms.geo.admin.ch%3Fservice%3DWMS%26request%3DGetCapabilities.
> (Reason: CORS request did not succeed).
>
> Any ideas how to fix this?
>
> Kind regards,
> Roman
>
>> Hi Roman
>>
>> This is likely a CORS issue, check the developer console output of your
>> browser. If not, if you can please post a link to the service you are
>> attempting to use.
>>
>> Best
>> Sandro
>>
>> On 03.01.20 11:07, Roman Meier wrote:
>>> Hi folks,
>>>
>>> A few days ago I installed the QWC 2 demo app on my server according to
>>> the documentation provided on github
>>> (gwc2-demo-app/doc/QWC2_Documentation.md).
>>>
>>> The installation went smoothly and the development application runs
>>> nicely.
>>>
>>> I then tried to connect to external wms services using "Import layer".
>>> However, none of the services seems to respond and consequently no
>>> layers
>>> get listed.
>>>
>>> Any ideas?
>>>
>>> Kind regards,
>>> Roman
>>>
>>> _______________________________________________
>>> qgis-qwc2 mailing list
>>> qgis-qwc2 at lists.osgeo.org
>>> https://lists.osgeo.org/mailman/listinfo/qgis-qwc2
>> _______________________________________________
>> qgis-qwc2 mailing list
>> qgis-qwc2 at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/qgis-qwc2
>>
>
> _______________________________________________
> qgis-qwc2 mailing list
> qgis-qwc2 at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/qgis-qwc2


More information about the qgis-qwc2 mailing list