私は実行時に "hi there"を返すデモフラスコアプリケーションをホストしようとしています。私はこの設定でUwsgiだけを使ってhttpとhttpsでアプリケーションをホストすることに成功しました。 私はhttpsの設定でローカルホスト上で自分のアプリケーションにアクセスしようとすると、私はここで私のdeployment.ini(uwsgi設定ファイル)が行くuginiとフラスコ付きのnginxがhttps接続のみの不正な要求を示しています
502. Bad Gatewat
nginx/1.4.6 (Ubuntu)
を取得
[uwsgi]
shared-socket = 127.0.0.1:8443
master = true
processes = 5
daemonize = /path/to/my/mylog.log
wsgi-file=/path/to/my/demo.py
callable=app
https= =0,ca.crt,ca.key,HIGH
私はUnixのもソケットと変るを使用して試してみました私は、アプリケーションを起動するだけuwsgiとできる第1の構成を使用して= 664
それ 共有ソケット= /パス/に/ my.soc chmodのソケット上のアクセス権が、私はそれが目を仕事にしたいですラフなnginx。ここ
は私のnginxの構成server {
listen 80;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
error_log /path/to/nginx_err.log;
listen 443 ssl default_server;
server_name localhost;
ssl_certificate path/to/ca.crt;
ssl_certificate_key path/to/ca.key;
location/{
uwsgi_pass 127.0.0.1:8443;
#uwsgi_pass unix:///path/to/my.soc;
include uwsgi_params;
}
}
それは、httpsのために完璧に機能していますが、私は私がhttpsに設定
を与えることをしようとすると何が起こっているのか知らない行く私のログファイルは/ var/log/nginxの/ error.log2016/03/22 15:58:07 [error] 12926#0: *2 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /user HTTP/1.1", upstream: "uwsgi://127.0.0.1:8443", host: "127.0.0.1"
私はすでにこれを整理するのに8時間を費やしましたが、できませんでした。 助けを歓迎します
完璧に働いた、ありがとう –