带有SpringBoot后端的Apache2反向代理

时间:2019-01-07 12:45:29

标签: apache spring-boot https apache2

我有一个使用SSL的Spring Boot REST API。后端使用端口8443,并且我想使用Apache 2反向代理,因此我可以使用init(exactly:)之类的域名代替https://www.example.com/api/v1/

这是Apache 2的配置:

let strangeNumber = NSDecimalNumber.notANumber          // nan
let integerRepresentation = Int(exactly: strangeNumber) // nil

这是SpringBoot配置:

<VirtualHost *:80>
    ServerName example.com
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>

<VirtualHost *:443>
    ServerName example.com
    ProxyPass / http://127.0.0.1:8443/
    ProxyPassReverse / http://127.0.0.1:8443/
</VirtualHost>

当我访问URL https://localhost:8443/api/v1/时,出现以下错误:

  

错误请求主机和端口的这种组合需要TLS。

0 个答案:

没有答案
相关问题