I'm stuck ...
I tried the @egsuh example here in my computer whit ubuntu...
I just added
location /test/ {
# include fastcgi.conf;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9100;
# fastcgi_split_path_info ^(/teste/)(.*)$;
# gzip off;
}
in /ect/nginx/sites-available/default and restarted nginx...
before restart I sudo nginx -t and returned everting is ok .
When I built my test app with (commented Application.port):
program test;
{$mode objfpc}{$H+}
uses
fpFCGI, unit_principal;
begin
Application.Title:='fcgiproject1';
{ Uncomment the port setting here if you want to run the
FastCGI application stand-alone (e.g. for NGINX) }
//Application.Port := 9100; // For example
Application.Initialize;
Application.Run;
end.
and try to access
http://localhost/test/test, I got a "502 Bad Gateway" in the browser with a
2021/10/04 16:37:47 [error] 1168#1168: *21 connect() failed (111: Unknown error) while connecting to upstream, client: 127.0.0.1, server: _, request: "GET /test/test HTTP/1.1", upstream: "fastcgi://127.0.0.1:9100", host: "localhost" in the tail -f /var/log/nginx/error.log
if I give a sudo spawn-fcgi -a127.0.0.1 -p9100 /var/www/http/test/test, works ok, create a process, but
http://localhost/test/test returns:
fcgiproject1: ERROR
The application encountered the following error:
Error: Not found
Stack trace:
$00000000004B216F
$00000000004B17D2
If I uncomment Application.Port := 9100 and rebuild ...
sudo spawn-fcgi -a127.0.0.1 -p9100 /var/www/http/test/test, it doesn't work and
http://localhost/test/test always returns: "502 Bad Gateway" doesn't matter combination of comments/uncomments in
location /test/ {
# include fastcgi.conf;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9100;
# fastcgi_split_path_info ^(/teste/)(.*)$;
# gzip off;
}
[Edited to add code tags - please read
How to use the Forum.]