I am struggling a bit with rewriting some urls in nginx
I have a site: foo.com/
foo.com/index.html has a link to foo.com/bar.cgi (maybe with with GET arguements)
my cgi resides in /var/www/site/cgi-bin/ and thus it is accesible via foo.com/cgi-bin/bar.cgi
I was hoping the rewrite would remove the cgi-bin part
location ~ \.cgi$ {
root /var/www/localhost;
#rewrite ^/cgi-bin/(.*)$ $1 permanent;
fastcgi_param SCRIPT_FILENAME/ /var/www/localhost$fastcgi_script_name;
include /etc/nginx/fastcgi.conf;
fastcgi_pass unix:/var/run/fcgi.sock-1;
}