使用HTTP Geoserver图层与我的HTTPS网站,错误混合内容。

huangapple go评论64阅读模式
英文:

Use HTTP Geoserver Layer with my HTTPS website, Error Mixed Content

问题

我刚刚在我的网站上安装了HTTPS证书。当我调用HTTP的geoserver链接时,出现了以下错误:

“页面' https://mywebsite/joomla/index.php/ '通过HTTPS加载,但请求不安全的XMLHttpRequest端点' http://mywebsite:8080/geoserver/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=WebPortal%3AAlert_province_boundary&maxFeatures=50&outputFormat=application%2Fjson '。此请求已被阻止;内容必须通过HTTPS提供。”

我无法通过HTTPS访问我的geoserver门户(只有http链接有效:http://mywebsite:8080/geoserver/)。

据我了解,我的HTTPS证书不包括我的geoserver门户,因为它在8080端口上运行。

如何使我的HTTPS证书覆盖我的geoserver web门户?

尝试:

1)我尝试配置一个Apache代理,但它不起作用:

在/ etc / apache2 / sites-available / 000-default.conf中添加以下行:

ProxyPreserveHost On

ProxyPass "/geoserver" "http://localhost:8080/geoserver"

ProxyPassReverse "/geoserver" "http://localhost:8080/geoserver"

2)我看到Geoserver有代理基本URL。我阅读了文档(https://docs.geoserver.org/latest/en/user/configuration/globalsettings.html#proxy-base-url),但我不太理解,文档对我来说不太清楚。

英文:

I just installed my HTTPS certificate on my website. As I call HTTP geoserver links, I have this error:

The page at 'https://mywebsite/joomla/index.php/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://mywebsite:8080/geoserver/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=WebPortal%3AAlert_province_boundary&maxFeatures=50&outputFormat=application%2Fjson'. This request has been blocked; the content must be served over HTTPS.

I can't access to my geoserver portal with HTTPS (only http link works: http://mywebsite:8080/geoserver/).

As I understand, my HTTPS certificate doesn't cover my geoserver portal because it's working on the 8080 port.

How to do to make my HTTPS certificate cover my geoserver web portal ?

Try:

  1. I try to configure an apache proxy but it's not working:

Adding of these lines in /etc/apache2/sites-available/000-default.conf:

> ProxyPreserveHost On
>
> ProxyPass "/geoserver" "http://localhost:8080/geoserver"
>
> ProxyPassReverse "/geoserver" "http://localhost:8080/geoserver"

  1. I saw to Geoserver has Proxy Base URL. I read the documentation (https://docs.geoserver.org/latest/en/user/configuration/globalsettings.html#proxy-base-url), I don't understand anything, the documentation is not clear for me.

答案1

得分: 0

这个命令解决了我的问题:sudo a2enmod proxy proxy_http proxy_ajp

英文:

This command solve my problem: sudo a2enmod proxy proxy_http proxy_ajp

huangapple
  • 本文由 发表于 2023年1月6日 14:02:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/75027481.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定