closures到apache HTTPS端口的HTTP连接

当一个客户端发出一个http请求到apache https VirtualHost apache响应:

 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>400 Bad Request</title> </head><body> <h1>Bad Request</h1> <p>Your browser sent a request that this server could not understand.<br /> Reason: You're speaking plain HTTP to an SSL-enabled server port.<br /> Instead use the HTTPS scheme to access this URL, please.<br /> </p> <hr> <address>Apache/2.4.7 (Ubuntu) Server at 127.0.0.1 Port 443</address> </body></html> 

我怎样才能使Apacheclosures连接或反应与适当的ssl / tls握手错误?

我有一个负载平衡器,通过尝试连接http然后使用https重试,了解后端池成员的端口是http还是https。 来自成员的400个错误请求错误遍历负载均衡器,并返回给客户端,而不是导致负载平衡器使用https重试。

我认为mod_write可能有帮助: https ://www.sslshopper.com/apache-redirect-http-to-https.html。

它会自动将HTTP请求redirect到HTTPS。

但是,如果您使用的是共享主机,或者无法使用.htaccess文件,则这可能不起作用。