Ubuntu サーバーで RC1 update 1 ランタイムを使用して DNX 4.5.1 を使用しています。バックエンド アプリケーションは Kestrel で実行され、localhost:5004 でリッスンします。私のフロントエンドは、リクエストをバックエンドにリダイレクトするnginxです。ただし、何らかの理由で nginx が Kestrel に接続できません。
2015/12/07 15:31:44 [error] 2263#0: *7 upstream timed out (110: Connection timed out) while reading upstream, client: 192.168.33.1, server: ribandelle.lan, request: "GET /api/track/2 HTTP/1.1", upstream: "http://127.0.0.1:5004/api/track/2", host: "ribandelle.lan"
私のアプリケーションは稼働中です:
arnaud@ubuntu:/var/log/nginx$ sudo netstat -tap | grep mono
tcp 0 0 localhost:5004 *:* LISTEN 2389/mono
tcp 0 0 localhost:48663 localhost:mysql ESTABLISHED 2389/mono
(2 行目は、データベースに接続するアプリケーションです)。
project.json ファイルでサーバーのさまざまなオプションを試しました。http://*:5004
Kestrelにhttp://localhost:5004
とを聞いてみましたhttp://127.0.0.1:5004
。どれも機能していないようです。私のnginx構成では、バックエンド(localhostと127.0.0.1)の異なるアドレスも試しましたが、成功しませんでした。これは、このアプリケーションの nginx 構成です。
upstream backend {
server 127.0.0.1:5004;
}
limit_req_zone $binary_remote_addr zone=api:10m rate=5r/s;
server {
listen 80;
server_name ribandelle.lan;
location / {
limit_req zone=api burst=15;
proxy_pass http://backend;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
}
}
nginx は、Ubuntu 15.04 のバージョン 1.6.2 です。何が問題なのかわからないので、助けていただければ幸いです。