2014-02-24 30 views
1

我正在使用nginx並使用golang's fcgi module運行fcgi協議。我怎樣才能讓nginx自動重新生成我的fcgi進程?nginx自動respawn fastcgi進程?

我的nginx.conf看起來

server { 
    listen 80; 
    server_name 127.0.0.1; 
    root /home/jdk2588/testdir; 
    index index.html; 
    location/{ 
     access_log /home/jdk2588/KARMA/nginx/access.log; 
     proxy_pass_header Server; 
     proxy_set_header Host $http_host; 
     proxy_redirect off; 
     proxy_set_header X-Real-Ip $remote_addr; 
     proxy_set_header X-Scheme $scheme; 
    } 
    location ~ /goapp { 
     include   fastcgi.conf; 
     fastcgi_pass 127.0.0.1:9001; 
    } 
} 

回答

3

the docs

與Apache或lighttpd的,Nginx的不自動產卵FCGI 過程。你必須單獨啓動它們。

所以你需要使用一個操作系統設施來做到這一點。

我的最愛是supervisord,但還有很多其他的方法。

當它死了,據我所知

0

我推薦使用uwsgi管理FCGI進程沒有重新啓動的過程中一展身手的方式。它能夠產生大量的工作進程準備好輸入並在死亡時重新啓動它們。高度可配置且易於安裝和使用。

http://uwsgi-docs.readthedocs.org/en/latest/

我有選擇工人-EXEC,假脫機程序,過程,協議,使線程和主集。