Problems with fastcgi php migration

Ian M. Evans ianevans at digitalhit.com
Sun Mar 9 10:58:37 MSK 2008


Philip Ratzsch wrote:
> [Caveat - in my limited experience, the rewrite engine in Nginx uses a very similar syntax to Apache's mod_rewrite module, so I'm hoping this is close enough that someone with more knowledge than I can correct any mistakes.  This does not take proxying into account, and simply serves as a logic example.  
 > These are not the droids you're looking for.]

Killed myself on the droids bit...also daylight saving kicked in and 2AM 
just became 3AM, so more coffee.

If I get what you're saying, you're suggesting creating a new .php file 
that, rather than looking for a PATH_INFO that may or may not be mangled 
through the FCGI process instead gets translated into ?variable=whatever 
in a rewrite from the old extensionless URI. Visitor still sees 
/galleries/123 but nginx translates it into galleries.php?event=123

I wouldn't need numeric length specifics as they can be any lenght and 
can be there or not.

e.g. /galleries gives the user a main menu
/galleries/[num] gives them an event (like a film festival)
/galleries/[num]/[num] gives them a subevent listing (like a premiere 
photo listing at a film festival)
and /galleries/[num]/[num]/[num] gives them a specific photo.

Fun and games. As I said people, regex is below a weakness for me so if 
there are any suggestions, I'm open.

At least the site is, and has been, fully functional in the Apache 
backend format...would love to go fully nginx soon though.





More information about the nginx mailing list