I have a "hello world" fastcgi running on 127.0.0.1:9000 and would like to serve it via nginx. I added the following lines to the nginx.conf http block:
server {
listen public.ip.address.here:80;
server_name $host;
location / {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
}
}
However, instead of getting the output of the fastcgi, I only get a 502 Bad Gateway response.
error_log says: [error] 1924#0: *1 upstream prematurely closed FastCGI stdout while reading response header from upstream, client: myIP, server: $host, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "public.ip.address.here"