写了个spring boot 的小项目,想要部署到服务器上测试的时候发现利用宝塔一键部署ssl失败,最后发现是宝塔(6.8.6)一键部署ssl出了问题。(tomcat的情况下)
http访问的时候正常,换成https就会报以下错误
<!doctype html><html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"><title>404</title><style>
body{
background-color:#444;
font-size:14px;
}
h3{
font-size:60px;
color:#eee;
text-align:center;
padding-top:30px;
font-weight:normal;
}
</style></head><body><h3>404,您请求的文件不存在!</h3></body></html>
最后发现是因为宝塔一键开启ssl时,网站的配置文件少了一段。
<VirtualHost *:80>下面有IfModule
<VirtualHost *:443>没有配置
只需要把80下面这段代码复制到443下面就可以了
大家可以自己在配置里面复制自己80的这段代码
#TOMCAT-START
<IfModule mod_proxy.c>
ProxyRequests Off
SSLProxyEngine on
ProxyPass / 自己的域名:8080/
ProxyPassReverse / 自己的域名:8080/
RequestHeader unset Accept-Encoding
ExtFilterDefine fixtext mode=output intype=text/html cmd="/bin/sed 's,:8080,,g'"
SetOutputFilter fixtext
</IfModule>
|