Welcome! Log In Create A New Profile

Advanced

Re: No input file specified by FastCGI

June 16, 2009 10:00AM
On Tue, Jun 16, 2009 at 09:39:55AM -0400, meal wrote:

> Hi,
> We have our own framework written in PHP, but it's using .html extension (and change of this is not possible).
> So when I put appropriate block in config, part of site is working, but few rewrites is not.
>
> here is my .html parsing block
>
> location ~ \.html$ {
> if (!-f $request-filename) { return 404; break; }
> root /path/to/files;
> fastcgi_pass 127.0.0.1:8000;
> fastcgi_index index.html;
> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
> fastcgi_intercept_errors on;
> include fastcgi_params;
> }
>
>
> and rewrite rule that isn't working there:
>
> rewrite ^/user/(.*)/moje.([0-9]+).html$ /moje.html?u=$1&showpage=$2 last;
> rewrite ^/user/(.*)/(content|lista)/([0-9]+).html$ /moje.html?otheruser=$1&showpage=$3 last;
> rewrite ^/user/(.*)/(content|lista).html$ /moje.html?otheruser=$1 last;
> rewrite ^/user/(.*)/(+).html$ /$2.html?u=$1 last;
>
> previously, at Apache, it was working fine (but a little bit slow, so we decide to move to nginx)

Try to move rewrites to specila location:

location ^~ /user/ {
rewrite ^/user/(.*)/moje.([0-9]+).html$
/moje.html?u=$1&showpage=$2 last;
...
}

Also, it's better to use try_files instead of

if (!-f $request-filename) { return 404; break; }

as here:

location ~ \.html$ {
try_files $uri /404.html;
...
}

location = /404.html {
root /path/to/files;
}


--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

No input file specified by FastCGI

meal June 16, 2009 09:39AM

Re: No input file specified by FastCGI

Igor Sysoev June 16, 2009 10:00AM

Re: No input file specified by FastCGI

meal June 16, 2009 10:59AM

Re: No input file specified by FastCGI

Igor Sysoev June 16, 2009 11:04AM

Re: No input file specified by FastCGI

edogawaconan June 16, 2009 11:17AM

Re: No input file specified by FastCGI

edogawaconan June 16, 2009 11:21AM

Re: No input file specified by FastCGI

meal June 16, 2009 11:49AM

Re: No input file specified by FastCGI

meal June 16, 2009 12:36PM

Re: No input file specified by FastCGI

Maxim Dounin June 16, 2009 12:12PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 164
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