nginx - nginx 自动重生 fastcgi 进程?

标签 nginx go fastcgi

我正在使用 nginx 并使用 golang's fcgi module 运行 fcgi 协议(protocol).我如何通过 nginx 自动重新生成我的 fcgi 进程?

我的 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;
    }
}

最佳答案

来自 the docs

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

因此您需要使用操作系统工具来执行此操作。

我最喜欢的是supervisord但还有很多其他方法可以做到这一点。

据我所知,当进程终止时没有重新启动进程的方法

关于nginx - nginx 自动重生 fastcgi 进程?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21988024/

相关文章:

nginx - 如果 nginx conf 文件中的条件串联

c - C中一个奇怪的字符串复制函数

php - 为什么浏览器将 info.html 的服务器 API 显示为 Apache 2.0 处理程序,而将 info.php 显示为 FPM/FastCGI?

go - 通过附加到golang中的现有 slice 来创建新 slice

c++ - 交换指针: equivalent of `std::unique_ptr::swap`

perl - 使用独立的 Perl FastCGI/FCGI Web 服务器在 Perl 中测试 FastCGI 脚本

cgi - 了解 Rails 中的 CGI/FastCGI

nginx - 使用 Openresty 向 Google Analytics 发送 http 请求

到 Cloudant 的 NGINX 代理

go - 在 Go 中如何从结构的 slice 中删除一个项目