Welcome! Log In Create A New Profile

Advanced

Still confused with try_files

All files from this thread

File Name File Size   Posted by Date  
patch.try_files.0.7.43 2.2 KB open | download Igor Sysoev 03/19/2009 Read message
patch.try_files.0.6.35.3 13.1 KB open | download Igor Sysoev 03/19/2009 Read message
mike
March 17, 2009 01:06AM
for a site with multiple "if file does not exist, use this master
controller file" like wordpress, drupal, etc, does a config like this
make sense?

because right now, it doesn't.

the /blog one does, but the /second one doesn.t

server {
listen 80;
server_name proto.foo.net;
index index.php index.html;
root /home/proto/web/proto.foo.net;
include /etc/nginx/defaults.conf;
include /etc/nginx/expires.conf;
location /blog {
error_page 404 = /wordpress/index.php?q=$request_uri;
}
location /second {
try_files $uri $uri/ /second/controller.php?slug=$request_uri;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:11020;
}
}


2009/03/16 21:40:29 [error] 29669#0: *638 rewrite or internal
redirection cycle while internal redirect to
"/second/controller.php?slug=/second/contro", client: 123.5.226.17,
server: proto.foo.net, request: "GET /second/contro HTTP/1.1", host:
"proto.mikehost.net"

I really want to use try_files as I believe it is better than using
error_page 404 and if ( !-e $request_filename) type stuff, right? All
I need is to understand the routing better and I'll be on my way. :)

I guess it makes sense about the internal redirection cycle but how
else can I route only requests to the prefix of /second to that
application's controller?

Thanks.
Subject Author Posted

Still confused with try_files

mike March 17, 2009 01:06AM

Re: Still confused with try_files Attachments

Igor Sysoev March 19, 2009 06:57AM

Re: Still confused with try_files

Otto Bretz March 19, 2009 10:20AM

Re: Still confused with try_files Attachments

Igor Sysoev March 19, 2009 10:37AM

Re: Still confused with try_files

Otto Bretz March 19, 2009 12:23PM

Re: Still confused with try_files

Igor Sysoev March 19, 2009 12:36PM

Re: Still confused with try_files

Otto Bretz March 20, 2009 08:09AM

Re: Still confused with try_files

Igor Sysoev March 20, 2009 10:13AM

Re: Still confused with try_files

Otto Bretz March 20, 2009 11:45AM

Re: Still confused with try_files

mike March 20, 2009 12:26AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 68
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready