# Not found file on symlink

**URL:** <https://www.ruby-forum.com/t/not-found-file-on-symlink/219994>\
**Category:** NGINX\
**Created:** [May 24, 2012, 11:07am UTC](https://www.ruby-forum.com/t/not-found-file-on-symlink/219994 "2012-05-24T11:07:58Z")\
**Posts on this page:** 2\
**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:** [May 24, 2012, 11:07am UTC](https://www.ruby-forum.com/t/not-found-file-on-symlink/219994/1 "2012-05-24T11:07:58Z")

</div>

Hi,

I use symlink on files, but nginx got error 404 on files.

I can access the file like this (no error):

[http://static.xxx.tld/kvr2wery235cd57uio457azd4a5Tf78sR/2012/20126190.pdf](http://static.xxx.tld/kvr2wery235cd57uio457azd4a5Tf78sR/2012/20126190.pdf)

but not like this

[http://static.xxx.tld/dlpdf/24052012w/20127063.pdf](http://static.xxx.tld/dlpdf/24052012w/20127063.pdf) this link is a  
symlink to this file  
[http://static.xxx.tld/kvr2wery235cd57uio457azd4a5Tf78sR/2012/20126190.pdf](http://static.xxx.tld/kvr2wery235cd57uio457azd4a5Tf78sR/2012/20126190.pdf)

Why the serveur said the file is not found ? I don’t understand

Here my conf:

server {  
listen 80;  
server\_name static.xxx.tld;  
root /home/www/static.xxx.tld;  
location / {  
return 404;  
}

```
location ~*

```

^.+.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|xml|swf|otf|eot)$  
{  
root /home/www/static.xxx.tld;  
expires 30d;  
add\_header Pragma public;  
add\_header Cache-Control “public”;  
}  
}

Thanks for your help  
Bye

Posted at Nginx Forum:

> **[not found file on symlink...](https://forum.nginx.org/read.php?2,226784,226784#msg-226784)**
>
> Hi, I use symlink on files, but nginx got error 404 on files. I can access the file like this (no error): http://static.xxx.tld/kvr2wery235cd57uio457azd4a5Tf78sR/2012/20126190.pdf but not like this http://static.xxx.tld/dlpdf

---

<div class="post-metadata">

**Author:** ![zuckbin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/ce7236/32.png) [@zuckbin](https://www.ruby-forum.com/u/zuckbin)\
**Post date:** [May 24, 2012, 2:43pm UTC](https://www.ruby-forum.com/t/not-found-file-on-symlink/219994/2 "2012-05-24T14:43:04Z")

</div>

Problem solved, it was a php issue, not nginx issue.

Sorry!

Posted at Nginx Forum:

> **[Re: not found file on symlink...](https://forum.nginx.org/read.php?2,226784,226801#msg-226801)**
>
> Hi, I use symlink on files, but nginx got error 404 on files. I can access the file like this (no error): http://static.xxx.tld/kvr2wery235cd57uio457azd4a5Tf78sR/2012/20126190.pdf but not like this http://static.xxx.tld/dlpdf
