2016-02-23 9 views
5

私はGunicornサービスを開始するときに、このコマンドを使用して起動します: gunicorn --certfile =/Projects/thebodyofchrist.us.crt --keyfile =/Projects/thebodyofchrist us.key bodyofchrist.wsgi -b 0.0.0.0:443 -b 0.0.0.0:80 -w 10httpとhttpsの両方でGunicornを実行

httpとhttpsの両方にgunicornをバインドするには - http:// http://www.google.com/support/bin/answer.py?hl =既存のパラメータ。 は私がhttp://domain.com/sample/request へのリンクの数百を持って、それが自動的にgunicornはジャンゴをホストしているhttps://domain.com/sample/request

に行く必要があります。

ありがとうございました!

答えて

1

Gunicornは非常にしっかりしたプロジェクトですが、私は彼らがSSLの優先順位を示すために、複数の結合ポートとコマンドラインスイッチを使用していつかそれを構築したいと考えています。

最終的には、ApacheまたはNginxの優れたロードバランシングを使用することになります。

しかし、開発中にポート80にバインドされたワーカーと、キーファイルとcertfileが設定されたポート443にバインドされたワーカーを実行することを妨げるものはありません。次に、ログインリンクを「絶対」URLとして書き込むことができます。ログイン後にhref = "https:// yoursite/login"と入力すると、httpsのURLが使用されます。

#!/bin/sh 
# put 8 workers as Daemon listening for HTTPS on 443 
gunicorn -D -w 8 --certfile=/Projects/thebodyofchrist.us.crt --keyfile=/Projects/thebodyofchrist.us.key bodyofchrist.wsgi -b 0.0.0.0:443 

# put 2 workers as Daemon listening for HTTP on port 80 
gunicorn -D -w 2 bodyofchrist.wsgi -b 0.0.0.0:80 
関連する問題