GeoServer 打印模块 - 下载 PDF 时出错

问题描述 投票:0回答:0

我完美地安装了 Geonode 和 Geoserver。 我配置了 nginx 代理在 https

上运行

到目前为止它有效:

GEOSERVER_DATA_DIR/printing/config.yaml 中的打印模块配置文件已创建,我可以看到访问

https://mydomainname/geoserver/pdf/info.json

我可以看到 打印网址:

https://mydomainname/geoserver/pdf/print.pdf
并创建 URL:
https://mydomainname/geoserver/pdf/create.json
info.json 中的参数

这是我的config.yaml

`#===========================================================================
# allowed DPIs
#===========================================================================
dpis:
  - 96
  - 150
  - 300

#===========================================================================
# the allowed scales
#===========================================================================
scales:
  - 0.35
  - 0.7
  - 1.5
  - 3.5
  - 7.0
  - 15.0
  - 35.0
  - 70.0
  - 150.0
  - 273.0
  - 546.0
  - 1093.0
  - 2187.5
  - 4375.0
  - 8750.0
  - 17500.0
  - 35000.0
  - 70000.0
  - 138000.0
  - 273437.5
  - 546875.0
  - 1093750.0
  - 2187500.0
  - 4375000.0
  - 8750000.0
  - 17500000.0
  - 35000000.0
  - 70000000.0
  - 140000000.0
  - 280000000.0

outputFilename: 'GeoNode-Map-${date}.pdf'
#== ms2 ===== 
disableScaleLocking: true
#======
brokenUrlPlaceholder: 'default'
# brokenUrlPlaceholder: 'throw'

proxyBaseUrl: https://mydomainname/geoserver/pdf
connectionTimeout: 2000
socketTimeout: 2000

#===========================================================================
# the list of allowed ips
#===========================================================================
hosts:
  - !ipMatch
    ip: 127.0.0.1
  - !localMatch
    dummy: true
  - !acceptAll
    dummy: true
  - !dnsMatch
    host: mydomainname
    port: 80
  - !dnsMatch
    host: localhost
    port: 80
  - !dnsMatch
    host: labs.metacarta.com
    port: 80
  - !dnsMatch
    host: terraservice.net
    port: 80
  - !dnsMatch
    host: tile.openstreetmap.org
    port: 80
  - !dnsMatch
    host: www.geocat.ch
    port: 80
  - !dnsMatch
    host: otile1.mqcdn.com
    port: 80
  - !dnsMatch
    host: otile2.mqcdn.com
    port: 80
  - !dnsMatch
    host: otile3.mqcdn.com
    port: 80
  - !dnsMatch
    host: otile4.mqcdn.com
    port: 80
  - !dnsMatch
    host: otile5.mqcdn.com
    port: 80
  - !dnsMatch
    host: a.tile.openstreetmap.org
    port: 80
  - !dnsMatch
    host: b.tile.openstreetmap.org
    port: 80
  - !dnsMatch
    host: c.tile.openstreetmap.org
    port: 80
  - !dnsMatch
    host: d.tile.openstreetmap.org
    port: 80
  - !dnsMatch
    host: a.tile.openstreetmap.fr
    port: 80
  - !dnsMatch
    host: b.tile.openstreetmap.fr
    port: 80
  - !dnsMatch
    host: c.tile.openstreetmap.fr
    port: 80
  - !dnsMatch
    host: d.tile.openstreetmap.fr
    port: 80
  - !dnsMatch
    host: en.unesco.org
    port: 80
  - !dnsMatch
    host: en.unesco.org/tiles
    port: 80
  - !dnsMatch
    host: en.unesco.org/tiles/geodata
    port: 80
  - !dnsMatch
    host: a.tile.openstreetmap.fr/hot
    port: 80
  - !dnsMatch
    host: api.mapbox.com
    port: 80
  - !dnsMatch
    host: api.mapbox.com/styles/v1/mapbox/satellite-streets-v9/tiles
    port: 80
  - !dnsMatch
    host: api.mapbox.com/styles/v1/mapbox/streets-v9/tiles
    port: 80

这是 NGINX 配置:

server {

  root /var/www/html;
  index index.html index.htm index.nginx-debian.html;

  server_name mydomainname;

  charset utf-8;

  etag on;
  expires $expires;
  proxy_read_timeout 600s;
  # set client body size to 2M #
  client_max_body_size 50000M;

  location / {
    etag off;
    uwsgi_pass 127.0.0.1:8000;
    uwsgi_read_timeout 600s;
    include uwsgi_params;
    proxy_pass http://localhost:8000/;
    include proxy_params;
  }

  location /geoserver {
    proxy_pass http://geoserver_proxy;
    include proxy_params;
    etag off;
    uwsgi_pass 127.0.0.1:8000;
    uwsgi_read_timeout 600s;
    include uwsgi_params;
  }

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/mydomainname/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/mydomainname/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

但是当我生成 pdf 时,create.json url 中的 getURL 参数带有 HTTP 而不是 HTTPS

http://mydomainname/geoserver/pdf/18439792855979453446.pdf.printout

请帮助我获取带有 HTTPS 模式的 pdf URL。 谢谢

geoserver mapfish
© www.soinside.com 2019 - 2024. All rights reserved.