Welcome! Log In Create A New Profile

Advanced

Re: Static files download

June 10, 2010 04:22AM
On Thu, Jun 10, 2010 at 12:05:06AM +0200, Grzegorz Sienko wrote:

> Hello.
>
> It's passed to fastcgi because of location / that captures uri to pass
> to fastcgi.
>
> I will say, that: It's not the best solution what Igor suggest. It
> will get rid of the problem, but is not a real solution.
>
> You should use:
>
> location ~ / {

The location above will handle all requests.

> try_files $uri $uri/ @framework;
> }
>
> location ~ \..*/.*\.php$ {
> return 403;
> }
>
> location ~ \.php$ {
> fastcgi_pass 127.0.0.1:9000;
> fastcgi_index index.php;
> fastcgi_param SCRIPT_FILENAME $document_root/index.php;
> include fastcgi_params;
> }
>
>
> > I tried to review all my configuration. I do not understand why PDF files are returned inline to the browser. Images, videos and flash files are properly sent, why not pdt and zip?
> > has anyone the same issue?
>
> You have it in debug log, in part where nginx test location. Because
> nginx test all you location that you have in your config, the uri with
> pdf file is captured by / location and proxed to fastcgi. With Igor
> suggestion, pdf will be added to static content location. But I will
> suggest, to properly configured the location that are responsible for
> capturing php file, because you will have a problem with all different
> types of files, that you don't put in that static location. like doc,
> xls, odt .. whatever.
>
> BTW, it's not better (for reader, at least :} )?:
>
> - location ~* \.css|\.js|\.jpg|\.jpeg|\.png|\.gif|\.swf|\.svg|\.tiff|\.pdf$ {
> + location ~* \.(css|js|jpg|jpeg|png|gif|swf|svg|tiff|pdf)$ {
>
> --
> Best Regards
> Grzegorz Sieńko
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx

--
Igor Sysoev
http://sysoev.ru/en/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Static files download

Axel June 09, 2010 10:44AM

Re: Static files download

Igor Sysoev June 09, 2010 10:46AM

Re: Static files download

Axel June 09, 2010 10:52AM

Re: Static files download

Igor Sysoev June 09, 2010 11:02AM

Re: Static files download

Axel June 09, 2010 11:40AM

Re: Static files download

Axel June 09, 2010 02:10PM

Re: Static files download

Igor Sysoev June 09, 2010 02:16PM

Re: Static files download

Grzegorz Sienko June 09, 2010 06:10PM

Re: Static files download

Axel June 10, 2010 04:18AM

Re: Static files download

Igor Sysoev June 10, 2010 04:22AM

Re: Static files download

Axel June 10, 2010 04:42AM

Re: Static files download

Axel June 10, 2010 06:28AM

Re: Static files download

Igor Sysoev June 10, 2010 08:20AM

Re: Static files download

Axel June 10, 2010 09:14AM

Re: Static files download

Igor Sysoev June 10, 2010 09:28AM

Re: Static files download

edogawaconan June 10, 2010 09:30AM

Re: Static files download

Axel June 10, 2010 10:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 279
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready