2017-08-02 17 views
1

少し前、NginxとSupervisordを使ってCentos7にMeteorアプリケーションをデプロイしました。それはここでは、正常に動作コンフィグファイルです: nginx.confNginx - 複数のアプリケーション

server { 
    listen  80 default_server; 
    listen  [::]:80 default_server; 
    server_name _; 
    root   /usr/share/nginx/html; 

    # Load configuration files for the default server block. 
    include /etc/nginx/default.d/*.conf; 

    location/{ 
     proxy_pass http://localhost:3003/; 
     proxy_set_header Host $host; 
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
     proxy_set_header Upgrade $http_upgrade; 
     proxy_set_header Connection "upgrade"; 
     proxy_http_version 1.1; 
    } 
} 

supervisord.conf:

[program:monitoring] 
command=node main.js    ; the program (relative uses PATH, can take args) 
directory=/home/[email protected]/bundle 
process_name=%(program_name)s ; process_name expr (default %(program_name)s) 
numprocs=1     ; number of processes copies to start (def 1) 
autostart=true    ; start at supervisord start (default: true) 
autorestart=unexpected  ; whether/when to restart (default: unexpected) 
;user=app_user     ; setuid to this UNIX account to run the program 
redirect_stderr=true   ; redirect proc stderr to stdout (default false) 
stdout_logfile=/var/log/meteor.log  ; stdout log path, NONE for none; default AUTO 
stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 
stdout_logfile_backups=10  ; # of stdout logfile backups (default 10) 
;stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 
;stdout_events_enabled=false ; emit events on stdout writes (default false) 
stderr_logfile=/var/log/meteor_err.log  ; stderr log path, NONE for none; default AUTO 
stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 
stderr_logfile_backups=10  ; # of stderr logfile backups (default 10) 
;stderr_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 
;stderr_events_enabled=false ; emit events on stderr writes (default false) 
environment=MONGO_URL="mongodb://<username>:<password>@localhost:27017/monitoring" ; process environment additions (def no adds) 

問題

今日、私がしたいですこのサーバーに別のアプリを置く。多くのチュートリアルが言ったように私は、私の最初の流星アプリの場所を変更しようとした、ことを実行します。

location /monitoring/ { 
    proxy_pass http://localhost:3003/; 
    ... 
} 

が、私は50倍のエラーを取得:

> [error] 23284#0: *8 connect() failed (111: Connection refused) while connecting to upstream, client: 10.20.3.135, server: _, request: "GET /monitoring/monitoringboard HTTP/1.1", upstream: "http://127.0.0.1:3003/monitoringboard", host: "10.20.3.249 

誰かが提案を持っているの?ありがとう

答えて

0

私は最終的に解決策を見つける。

nginx.config:

location /monitoring { 
    proxy_pass http://localhost:3003; 
    ... 
} 

supervisord.confg:

[program:monitoring] 
.... 
environment=PORT="3003,ROOT_URL="http://10.20.3.249/monitoring", MONGO_URL="mongodb://<username>:<password>@localhost:27017/monitoring" 
関連する問題