This should be my last question regarding FastCGI and NGINX (I've asked way too many already), but I had a question regarding running C FastCGI scripts on a web server, specifically NGINX. So right now this is how my nginx.conf file looks like:
user nobody nobody;
events {
worker_connections 1024;
}
http {
server {
listen 80;
server_name localhost;
location / {
root /nginx/html;
index index.html index.htm new.html;
autoindex on;
fastcgi_pass 127.0.0.1:8000;
}
}
}
I have a simple C FastCGI script that prints out Hello World. I know that in order to run this script, I first have to compile the C script which would result in a binary. I then execute this binary using spawn-fcgi -p 8000 -n <binary> or cgi-fcgi -start -connect localhost:8000 ./<binary>. I have had success doing this and displaying the correct results. However, when I do this, the CGI script is the only thing that is being displayed on the web server. I cannot go to any .html page or any other page for that matter. Even if I type in a random extension which should result in a 404 Page not Found error, the CGI script is being displayed. Basically I'm trying to have a index.html be the home page and then when the user clicks on a button, the user is taken to a new page that displays the C CGI script.
Is this possible? If so, how could I do it? I have spent hours trying to find a solution online but have had no success. Please let me know if the question is too vague/unclear or if you need more information! Thank you!