I want to use my RPi to source some data wirelessly. I'm working from Derek Molloy's Exploring Raspberry Pi. Step 1: get nginx working. I wrote my own index.html file and can get to it over my local LAN. So nginx works. Now I want to add cgi capability so, eventually, I can write a C or C++ program to control a device and return data.
So I followed the instructions on P. 490-491 of Molloy's book, adding fcgiwrap and adding the necessary include line in Nginx default. I typed in the simple cgi script with nano. ./test.cgi gives the expected result. So when I query:
192.168.1.135/cgi-bin/test.cgi
the response is: 502 bad gateway
This has to be a brain-dead simple problem, but I can't find anyone with exactly this issue. 502 bad gateway with Apache? Sure. But what 3 characters or directory settings or other simple stuff do I need to check? Thanks.
Nginx config file (with most commented-out lines removed):
server {
listen 80 default_server;
include /etc/nginx/fcgiwrap.conf;
listen [::]:80 default_server;
# root ~/data/www;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html;
server_name _;
}