我正在使用 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/