doujiao6507 2014-02-24 12:38
浏览 23
已采纳

由nginx自动重生fastcgi过程?

I am using nginx and running fcgi protocol using golang's fcgi module. How can I respawn my fcgi process automatically by nginx ?

My nginx.conf looks like

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;
    }
}
  • 写回答

2条回答 默认 最新

  • douzhaiya3968 2014-02-24 16:58
    关注

    From the docs

    Unlike Apache or Lighttpd, Nginx does not automatically spawn FCGI processes. You must start them separately.

    So you'll need to use an OS facility to do that.

    My favourite is supervisord but there are lots of other ways of doing it.

    There isn't a go way of restarting a process when it dies as far as I know

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 AlphaTensor复现(有偿)
  • ¥15 (有偿)在ANSYS中 .anf文件
  • ¥45 关于#芯片#的问题:组合逻辑电路设计
  • ¥15 基与机器学习和时间序列分析预测养老服务需求趋势
  • ¥100 求连续两帧图像在水平和垂直上偏移
  • ¥15 mysql全文索引查找指定必须关键词word无效
  • ¥15 Verilog hdl密码锁设计
  • ¥35 基于python的有ssl加密传输的socket聊天室
  • ¥15 数码管亮度控制器设计
  • ¥15 kafka客户端跨网段访问,看日志提示连接的还剩内网地址,且访问不通