2017-01-02 10 views
0

私はopenhiftフリー層で実行されているスケーリングされたgolangアプリケーションを持っています。それは、https://github.com/zolamk/openshift-goにあるカスタムcartidgeを使用し、私はhttpをhttpsにリダイレクトするようにしたいので、私の質問に、私は.htaccessファイルを使用してTechnical FAQsでガイド次試みたが、haproxyは、ロードバランサとして使用されているかもしれないので、それは、動作しませんでしたできるだけ私のアプリケーションコードに触れることなくHTTPトラフィックをHTTPSにリダイレクトする方法はありますか?は多分haproxy.cfgファイルを変更することで、ここで私の `haproxy.cfgファイルがオープンシフトgolangアプリでhttpをhttpsにリダイレクトする方法は?

defaults 
    mode     http 
    log      global 
    option     httplog 
    option     dontlognull 
    option http-server-close 
    #option forwardfor  except 127.0.0.0/8 
    option     redispatch 
    retries     3 
    timeout http-request 10s 
    timeout queue   1m 
    timeout connect   10s 
    timeout client   1m 
    timeout server   1m 
    timeout http-keep-alive 10s 
    timeout check   10s 
    maxconn     128 

listen stats 127.9.80.3:8080 
    mode http 
    stats enable 
    stats uri/

listen express 127.9.80.2:8080 
    cookie GEAR insert indirect nocache 
    option httpchk GET/
    http-check expect rstatus 2..|3..|401 

    balance leastconn 
    server gear-586a4c732d52711f96000127-zolamk ex-std-node847.prod.rhcloud.com:65326 check fall 2 rise 3 inter 2000 cooki$ 
    server local-gear 127.9.80.1:8080 check fall 2 rise 3 inter 2000 cookie local-586a492489f5cfef6a00002a 

おかげのように見えるものです。

答えて

0

あなたがあなたの耳を傾けセクションに以下を追加することができますHTTPSトラフィックを強制する場合:

redirect scheme https code 301 if !{ ssl_fc }

いますが、

aswellポート443でリスニングするようにする必要があるだろう
関連する問題