安装GeoServer,配置CORS

先安装 OpenJDK 11 for Windows

下载并安装,选择OpenJDK的主目录,默认管理员账号admin geoserver

http://localhost:8080/geoserver/

百度  openjdk 11 windows download

(我是放到百度网盘里面了)

网上说的修改 web.xml文件 关闭CORS,但是tomcat log提示缺少filter class

解决办法

安装nginx(zip包解压缩)

启动nginx

测试 http://localhost/

杀掉nginx进程 nginx -s stop

修改nginx.conf

location /Geoserver {
            proxy_pass http://localhost:8080/geoserver; # GeoServer URL
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;

            #*星号代表任意跨源请求都支持
            add_header Access-Control-Allow-Origin '*';  
            add_header Access-Control-Allow-Credentials "true";
            add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
            add_header Access-Control-Allow-Headers  'token,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,XRequested-With';
            if ($request_method = 'OPTIONS') {
                return 200;
            }
    
        }

启动nginx

测试 http://localhost/geoserver

其他:

安装Chrome浏览器

关闭Windows 2019防火墙

安装vscode 作为conf和html编辑器

相关推荐

  1. 安装GeoServer配置CORS

    2024-02-17 19:14:01       31 阅读
  2. Docker 安装 GeoServer

    2024-02-17 19:14:01       18 阅读
  3. docker 部署postgres 、geoserver

    2024-02-17 19:14:01       32 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-02-17 19:14:01       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-02-17 19:14:01       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-02-17 19:14:01       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-02-17 19:14:01       20 阅读

热门阅读

  1. 面试计算机网络框架八股文十问十答第六期

    2024-02-17 19:14:01       35 阅读
  2. 国产计算机的种类和应用

    2024-02-17 19:14:01       30 阅读
  3. 实现钉钉自定义机器人推送markdown类型消息

    2024-02-17 19:14:01       30 阅读
  4. 4 存储器管理(上)

    2024-02-17 19:14:01       32 阅读
  5. 倒计时52天(待续,,,

    2024-02-17 19:14:01       29 阅读
  6. Leetcode 496. 下一个更大元素 I

    2024-02-17 19:14:01       29 阅读