Symlink in nginx problem

I use symlink in my perl script.
e.p.

 symlink("$c->{upload_dir}/$dx/$file_code","$c->{htdocs_dir}/$rand/$file_name")
|| &Send("ERROR:sym_create_failed");

It runs smooth in apache.But it aways get 500 or 504 in nginx.
here is my nginx configuration:

location ~ .*\.cgi$ {
 gzip off;
fastcgi_pass 127.0.0.1:8999;
fastcgi_index index.cgi;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME /home/www/website$fastcgi_script_name;
include scgi_params;

I made my perl cgi run under www:www.
And my perl script also under www:www.

But why i always return 500 or 504 ? Is that mean symlink can’t run in
nginx?

Please help,best regards.

Posted at Nginx Forum: