Welcome! Log In Create A New Profile

Advanced

Re: Attempt to rewrite using slightly deprecated /foo.php/bar/ methods

October 27, 2009 12:38AM
Okay I'm trying to request

http://dev.foo.com/login for example, I get this:

2009/10/26 21:29:04 [error] 22831#0: *1 open()
"/home/mike/web/foo.com/loader.php/login" failed (20: Not a
directory), client: 192.168.1.2, server: dev.foo.com, request: "GET
/login HTTP/1.1", host: "dev.foo.com"

Here's the server block... I tried following your instructions.

server {
listen 80;
server_name dev.foo.com;
root /home/mike/web/foo.com;
index index.php index.html;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:11000;
}
location / {
try_files $uri $uri/ /loader.php$uri;
}
location /loader.php {
fastcgi_split_path_info ^(/loader\.php)(.*)$;
}
}



2009/10/26 Igor Sysoev <is@rambler-co.ru>:
> On Sun, Oct 25, 2009 at 09:23:02PM -0700, Michael Shadle wrote:
>
>> I have a script which has aliases like /login and such. If the file
>> does not exist, it's supposed to go to
>>
>> /controller.php/login
>>
>> Where controller.php will look up based on the URI and a whitelist of
>> aliases and load the appropriate script. However when I try this:
>>
>> if (!-e $request_filename) {
>>   rewrite ^(.+)$ /controller.php/$uri last;
>> }
>>
>> I get an infinite loop.
>>
>> Is there a way to setup some sort of rewrite (I also tried try_files)
>> to make this behavior happen? I tried hacking the controller script
>> but I'm worried changing it from URI parsing to a GET argument will
>> mess up other internals of the script (it's a third party script)
>>
>> Thanks... I've done this in Zeus and Apache before but apparently
>> never tackled it in nginx yet.
>
>   location / {
>       # damned "if", neutral "error_page", or blessed "try_files" :)
>   }
>
>   location /controller.php {
>       fastcgi_split_path_info     ^(/controller\.php)(.*)$;
>       ...
>   }
>
>
> --
> Igor Sysoev
> http://sysoev.ru/en/
>
>
Subject Author Posted

Attempt to rewrite using slightly deprecated /foo.php/bar/ methods

mike October 26, 2009 12:30AM

Re: Attempt to rewrite using slightly deprecated /foo.php/bar/ methods

Igor Sysoev October 26, 2009 07:14AM

Re: Attempt to rewrite using slightly deprecated /foo.php/bar/ methods

mike October 27, 2009 12:38AM

Re: Attempt to rewrite using slightly deprecated /foo.php/bar/ methods

Igor Sysoev October 27, 2009 02:02AM

Re: Attempt to rewrite using slightly deprecated /foo.php/bar/ methods

mike October 27, 2009 05:28AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 117
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready