11 messages in ru.sysoev.nginxRe: drupal try_files php fastcgi
FromSent OnAttachments
Otto BretzMar 14, 2009 3:13 am 
Igor SysoevMar 14, 2009 8:44 am 
Otto BretzMar 16, 2009 2:03 am 
Igor SysoevMar 16, 2009 3:33 am 
mikeMar 16, 2009 9:26 am 
Cliff WellsMar 16, 2009 9:51 am 
Igor SysoevMar 16, 2009 10:12 am 
Igor SysoevMar 16, 2009 10:15 am 
Cliff WellsMar 16, 2009 10:21 am 
Mark AlanMar 16, 2009 1:42 pm 
Leon KellermannMar 16, 2009 8:24 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: drupal try_files php fastcgiActions...
From:Igor Sysoev (is@rambler-co.ru)
Date:Mar 16, 2009 10:12:20 am
List:ru.sysoev.nginx

On Mon, Mar 16, 2009 at 09:51:55AM -0700, Cliff Wells wrote:

http://wiki.nginx.org/NginxJoomla

I find that basic recipe works for a lot of PHP frameworks.

Does Joomla require "/index.php?q=$request_uri" ? When I have checked on their site, just /index.php was enough.

It's better to use try_files:

root /path/to/root;

location / { try_files $uri $uri/ @fallback; }

location ~ \.php$ { try_files $uri @fallback;

fastcgi_pass ...;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # or just # fastcgi_param SCRIPT_FILENAME $document_root$uri; # as here $fastcgi_script_name == $uri fastcgi_param QUERY_STRING $query_string;

# other fastcgi_param's }

location @fallback { fastcgi_pass ...;

fastcgi_param SCRIPT_FILENAME $document_root/index.php; fastcgi_param QUERY_STRING q=$request_uri;

# other fastcgi_param's }

Probably, you can use omit @fallback:

location / { try_files $uri $uri/ /index.php?q=$request_uri; }

location ~ \.php$ { try_files $uri /index.php?q=$request_uri; ... }

On Mon, 2009-03-16 at 09:26 -0700, mike wrote:

2009/3/16 Igor Sysoev <is@rambler-co.ru>:

Have you @drupal location ?

This is one thing I want to get up on the wiki cookbook, a simple

@wordpress @drupal

etc.

Simple being the key word.

A lot of people do wordpress crap with wp-content/*.js and all these other filters and all you need is a simple

if (!-e $request_filename) {} or try_files $uri $uri/ @wordpress or try_files $uri $uri/ /path/to/main/wordpress/index.php

etc.

right now i run my blog using this:

error_page 404 = /wordpress/index.php?q=$request_uri;

works like a charm. i do want to start using try_files as I assume that is more efficient and not kind of a silly hack "hey, if it's a 404, use -this- as the page handler!"