Geoserver 跨域问题解决

geoserver 默认是不允许跨域访问的,不过还好可以配置打开

我的版本是geoserver-2.12.5

1.去geoserver所在目录

cd /usr/local/geoserver-2.12.5

2.修改webapps/geoserver/WEB-INF/web.xml

找到CORS,有两处需要把注释打开

<!– Uncomment following filter to enable CORS –>
   <filter>
        <filter-name>cross-origin</filter-name>
        <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
    </filter>

 

<!– Uncomment following filter to enable CORS –>
    <filter-mapping>
        <filter-name>cross-origin</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

 

3.ok 重启geoserver即可

 

求打赏

转载自:https://blog.csdn.net/QiaoDouTec/article/details/83345797

You may also like...