# Symlink in nginx problem

**URL:** <https://www.ruby-forum.com/t/symlink-in-nginx-problem/201436>\
**Category:** NGINX\
**Created:** [January 7, 2011, 8:36am UTC](https://www.ruby-forum.com/t/symlink-in-nginx-problem/201436 "2011-01-07T08:36:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [January 7, 2011, 8:36am UTC](https://www.ruby-forum.com/t/symlink-in-nginx-problem/201436/1 "2011-01-07T08:36:42Z")

</div>

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

```auto
 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:

```auto
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:

> **[symlink in nginx problem](https://forum.nginx.org/read.php?2,164271,164271#msg-164271)**
>
> I use symlink in my perl script. e.p. \[code\] symlink("$c-\>{upload\_dir}/$dx/$file\_code","$c-\>{htdocs\_dir}/$rand/$file\_name") || &Send("ERROR:sym\_create\_failed"); \[/code\] It runs smooth in apache.But it aways g
