2013-07-18 61 views
0

我正在致力於haproxy。我想用http打開我的網站。我購買了SSL證書並安裝在服務器上。無法使用https啓動域名

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我沒有得到任何錯誤後,

,當我運行的URL http://ec2-instance,其做工精細

但同時運行https://ec2-instance

我收到錯誤:

鉻:錯誤代碼:ERR_SSL_PROTOCOL_ERROR

在Firefox中:錯誤代碼:ssl_error_rx_record_too_long

如何解決錯誤

回答

1

檢查,以確保您的EC2安全規則允許端口443到正在運行的實例。一個簡單的測試方法是從客戶端使用telnet:

telnet ec2-instance 443