我有以下 iptable 条目:
REDIRECT tcp -- anywhere anywhere tcp dpt:http redir ports 8443
Run Code Online (Sandbox Code Playgroud)
在我的 server.xml 中,我只有以下连接器:
<Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
clientAuth="false" sslEnabledProtocols="TLSv1,TLSv1.1,TLSv1.2" SSLEnabled="true"
URIEncoding="UTF-8" keyAlias="tomcat" keystorePass="pass" keystoreFile="/home/myhome/.keystore" />
Run Code Online (Sandbox Code Playgroud)
当我使用来自 Firefox 的 http 说时,我看到一个对类型为 application/octet-stream 的小(7 字节)文件的 GET 请求,而不是使用 https 时我将获得的页面。我正在使用 Ubuntu 18 和 Tomcat 8。
如何配置将 http 重定向到 https?