Welcome! Log In Create A New Profile

Advanced

Re: cgi-bin and nginx

Francis Daly
August 10, 2020 05:44AM
On Sun, Aug 09, 2020 at 09:34:20PM -0600, The Doctor wrote:

Hi there,

> location /cgi-bin/ {
> #try_files $uri =404 ;
> gzip off;
> root /usr/local/www/apache24/cgi-bin/;
> fastcgi_pass unix:/var/run/fcgiwrap/fcgiwrap.sock;
>
> include /usr/local/etc/nginx/fastcgi_params;
> fastcgi_param SCRIPT_FILENAME /usr/local/www/apache24/cgi-bin/$fastcgi_script_name;
> }

> And In my error log I have

> 2020/08/09 21:25:24 [debug] 50073#101493: *1 http upstream request: "/cgi-bin/syswatch.pl?"
> 2020/08/09 21:25:24 [debug] 50073#101493: *1 http upstream process header

> 2020/08/09 21:25:24 [debug] 50073#101493: *1 http fastcgi header: "Status: 403 Forbidden"

I think that says that your fastcgi server is returning 403 to nginx,
so nginx is returning that to the client.

You should probably ask your fastcgi server why it is returning 403.

If you look back a bit in your error log, you will probably see some
lines like

fastcgi param: "SCRIPT_FILENAME:
/usr/local/www/apache24/cgi-bin//cgi-bin/syswatch.pl"

which indicate exactly what key/value pairs nginx is presenting to your
fastcgi server.

If the fastcgi server logs are not clear enough, perhaps you can use those
"fastcgi param" values to work out what is going wrong.

Does the user that the fastcgi service runs as, have access to execute
the file that nginx invites it to process? Perhaps, as that user

ls -l /usr/local/www/apache24/cgi-bin//cgi-bin/syswatch.pl

or

ls -ld /usr/local/www/apache24/cgi-bin/cgi-bin/
ls -ld /usr/local/www/apache24/cgi-bin/
ls -ld /usr/local/www/apache24/

etc will show if there is a permission problem?

Good luck with it,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

cgi-bin and nginx

The Doctor August 09, 2020 11:36PM

Re: cgi-bin and nginx

Francis Daly August 10, 2020 05:44AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 61
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready