【问题标题】:how enable SSL klokantech tileserver如何启用 SSL klokantech tileserver
【发布时间】:2018-07-31 09:33:08
【问题描述】:

我在我的项目中使用这个 tileserver - https://openmaptiles.com/server/(我在 Docker 中使用它)。

如何在 webserver (ubuntu server 18.04) 中启用 HTTPS 协议?

【问题讨论】:

    标签: docker ssl openmaptiles


    【解决方案1】:

    您好,我已在启用 vhost 的服务器中通过 certbot 启用 https。

    map.conf (http)

    <VirtualHost *:80>
    ServerName map.xxx.com
    ServerAlias map.xxx.com
    ServerAdmin webmaster@localhost
    
    
    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/
    ProxyPreserveHost On
    ProxyRequests Off
    
    
    RewriteEngine on
    RewriteCond %{SERVER_NAME} =map.xxx.com
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
    

    但问题是 /styles/positron/style.json 有 http 请求。所以会导致混合内容问题。

    我已经尝试了所有方法(将 style.json 中的 http 更改为 https 会导致其他错误),但与此问题无关。

    如果有帮助,也许你会找到下一个问题的解决方案。

    编辑:只需添加

    RequestHeader set X-Forwarded-Host "map.xxx.com"
    RequestHeader set X-Forwarded-Proto "https"
    

    在 certbot 生成的 https vhost conf 上。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-13
      • 2011-07-01
      • 2020-06-13
      • 1970-01-01
      相关资源
      最近更新 更多