# Deny requests of any file without authentication

**URL:** <https://www.ruby-forum.com/t/deny-requests-of-any-file-without-authentication/193393>\
**Category:** NGINX\
**Created:** [August 17, 2010, 12:28am UTC](https://www.ruby-forum.com/t/deny-requests-of-any-file-without-authentication/193393 "2010-08-17T00:28:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![caio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/67e7ee/32.png) [@caio](https://www.ruby-forum.com/u/caio)\
**Post date:** [August 17, 2010, 12:28am UTC](https://www.ruby-forum.com/t/deny-requests-of-any-file-without-authentication/193393/1 "2010-08-17T00:28:27Z")

</div>

> [@](#):
>
> Hi guys.
> 
> Try to access this image:
> 
> [https://mail.google.com/mail/pimages/2/up/buzz-icon2.png](https://mail.google.com/mail/pimages/2/up/buzz-icon2.png)
> 
> Gmail doesn’t allow your request and redirect you to login, after that  
> you will be able to see the image.
> 
> I use php + nginx + fastcgi + mongodb and can’t do this trick with  
> sessions (not with images) or http authentication (user’s password must  
> be in database), what should I do ? ☹
> 
> Thanks

I’ve asked this question before without success. So I come here begging  
for help because I’m going crazy spending nights without a god damn  
answer =( I really don’t know what to do, I tried some things but it’s a  
big mess:

Configuration of Nginx: [codeviewer.org](http://codeviewer.org/view/code:1128)  
CheckReq.php: [codeviewer.org](http://codeviewer.org/view/code:1129)

Posted at Nginx Forum:

> **[Deny requests of any file without authentication](https://forum.nginx.org/read.php?2,120496,120496#msg-120496)**
>
> \[quote\] Hi guys. Try to access this image: https://mail.google.com/mail/pimages/2/up/buzz-icon2.png Gmail doesn't allow your request and redirect you to login, after that you will be able to see the image. I use php + nginx + fastcgi
