# apt install fcgiwrap
/etc/nginx/sites-available/default
... #CGI location ~ \.cgi$ { root /var/www/html/; fastcgi_pass unix:/var/run/fcgiwrap.socket; fastcgi_index index.cgi; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } ...
# yum install epel-release # yum install spawn-fcgi fcgi-devel # yum install fcgiwrap
# which fcgiwrap /sbin/fcgiwrap # vi /etc/sysconfig/spawn-fcgi OPTIONS="-u nginx -g nginx -a 127.0.0.1 -p 9001 -P /var/run/spawn-fcgi.pid -- /sbin/fcgiwrap" # systemctl status spawn-fcgi # systemctl start spawn-fcgi # systemctl status spawn-fcgi # chkconfig --list # /sbin/chkconfig spawn-fcgi on # chkconfig --list
server { (abbr) location ~ \.cgi$ { root /usr/share/nginx/html/; fastcgi_pass 127.0.0.1:9001; fastcgi_index index.cgi; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } (abbr) }