我正在研究haproxy
。我想用http
打开我的网站。我已经购买了ssl证书并在服务器上安装。
在ha.cfg
我配置如下:
global
tune.bufsize 32786
tune.maxrewrite 16384
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
maxconn 8192
user haproxy
group haproxy
daemon
defaults
log global
mode http
option httplog
option dontlognull
retries 3
option redispatch
balance roundrobin
stats enable
stats refresh
stats uri /ssproxy_stats
stats realm Haproxy\ Statistics
stats auth haproxy:haproxy
maxconn 4000
contimeout 5000
clitimeout 50000
srvtimeout 50000
frontend http
bind *:80
acl hari path_beg /customers
acl css path_beg /assets
reqadd X-Forwarded-Proto:\ http
use_backend appointpress_app if hari
use_backend appointpress_app if css
default_backend appointpress_site
frontend https
bind *:443 ssl crt /etc/ssl/ssl.key/mydomain.crt
default_backend appointpress_site
backend appointpress_app :80
stats enable
stats auth haproxy:haproxy
cookie SERVERID insert
option httpclose
option forwardfor
server app_server ec2-elastic-domain:80 cookie haproxy_app check
backend appointpress_site :80
stats enable
stats auth haproxy:haproxy
cookie SERVERID insert
option httpclose
option forwardfor
server wordpress someip:443 cookie haproxy_site check
运行命令haproxy -f ha.cfg
后,我没有收到错误,
当我运行网址http://ec2-instance
时,其工作正常
但在运行https://ec2-instance
时,
我收到错误:
chrome中的:错误代码:ERR_SSL_PROTOCOL_ERROR
:错误代码:ssl_error_rx_record_too_long
如何解决错误
答案 0 :(得分:1)
检查以确保您的EC2安全规则允许端口443到您正在运行的实例。测试此方法的一种简单方法是使用客户端的telnet:
telnet ec2-instance 443