我正在开发一个Web Map 应用程序,需要访问Geoserver,我安装了wampserver来加载我的php和html / js文件 .

我可以使用jsonp格式从Geoserver访问数据,但由于CORS策略,我无法发送添加/更新/删除操作的WFS-T请求 .

我试图在web上找到许多解决方案,这里是stackoverflow,但我遇到了同样的问题

http://localhost:8080/geoserver/wfs [HTTP / 1.1 403禁止3毫秒]

Blocage d'unerequêtemulti-origines(Cross-Origin Request):la politique«Same Origin»ne permet pas de consulter la ressourcedistantesituéesurhttp://localhost:8080/geoserver/wfs . Raison:l'en-têteCORS«Access-Control-Allow-Origin»est manquant .

这意味着由于缺少Access-Control-Allow-Origin标头而阻止了请求 .

I checked the headers_module in apache

检查apache中的headers_module并将以下行添加到C:\ wamp64 \ bin \ apache \ apache2.4.17 \ conf中的httpd.conf文件中

<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin: *
</IfModule>

这是来自Apache方面,关于Geoserver Side我该如何启用它?