Welcome! Log In Create A New Profile

Advanced

Re: Rewrite problem http://x.x.x.x/folder_name/index.php/css/first.css

Francis Daly
November 07, 2011 02:44PM
On Mon, Nov 07, 2011 at 11:17:14AM -0500, mikolajj wrote:

Hi there,

> Apache and lighttpd can use URL
> http://x.x.x.x/folder_name/index.php/css/first.css as
> http://x.x.x.x/folder_name/index.php with REQUEST_URI part =
> "/css/first.css" - this is handle by PHP and processed along...
>
> Nginx is trying to open index.php as folder an of course 404 is
> thrown...

Yes, that's how it is frequently configured by default.

You'll want to configure it to match your application.

> location ~ .php$ {
> fastcgi_pass 127.0.0.1:9000;
> fastcgi_index index.php;
> fastcgi_param SCRIPT_FILENAME
> /home/main-www$fastcgi_script_name;
> include fastcgi_params;
> }

That location matches urls that end in "php". Your url is
/folder_name/index.php/css/first.css, which doesn't end in php,
so you'll want to use some location setting that matches that url --
perhaps "starts with /folder_name/index.php/" will be best.

For testing, you could use "includes php", which would be

location ~ php {}

but that is unlikely to be good for the live site.

Once you have the location definition correct, you'll want to use
fastcgi_split_path_info

http://wiki.nginx.org/HttpFcgiModule#fastcgi_split_path_info

and then you'll probably want to set PATH_INFO or REQUEST_URI or whatever
your application requires, like in the example there.

> Can you point me to some clues or solution?

Hopefully the above makes sense.

Either change your current "php" location to match all urls you want
handled by php; or make a new one that matches this location.

And use fastcgi_split_path_info.

And the debug log can be very useful if you get lost.

Good luck,

f
--
Francis Daly francis@daoine.org

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

Rewrite problem http://x.x.x.x/folder_name/index.php/css/first.css

mikolajj November 07, 2011 08:43AM

Re: Rewrite problem http://x.x.x.x/folder_name/index.php/css/first.css

Francis Daly November 07, 2011 02:44PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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