hone
January 14, 2010, 12:05am
1
I am trying a SSI set up but it seems that nginx is not using
memcached for the partials.
If I place the url for the partials in the directory nginx will use
memcached.
For the SSI includes it does not use memcached but redirects to php?
location /dssi/ {
set $memcached_key $host$request_uri;
memcached_pass 127.0.0.1:11244;
default_type text/html;
error_page 404 = /partial_index.php?q=$uri;
}
location ~ /partial_index.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
/home/testing/public_html$fastcgi_script_name;
include /usr/local/nginx/conf/fastcgi_params;
}
hone
January 14, 2010, 2:01am
2
Hello!
On Thu, Jan 14, 2010 at 10:05:24AM +1100, Hone W. wrote:
I am trying a SSI set up but it seems that nginx is not using
memcached for the partials.
If I place the url for the partials in the directory nginx will use memcached.
For the SSI includes it does not use memcached but redirects to php?
nginx does what you said to. Probably you have no relevant keys
in memcached.
location /dssi/ {
set $memcached_key $host$request_uri;
Note: you use original request uri as got from client (uri of
original request, with arguments)…
memcached_pass 127.0.0.1:11244;
default_type text/html;
error_page 404 = /partial_index.php?q=$uri;
… and you pass subrequest uri into your script (without
arguments). They aren’t likely has 1 to 1 relationship, so I
suppose you lost required information here.
}
location ~ /partial_index.php$ {
Just a side note: use “location = /partial_index.php” instead,
unless you really need postfix matching as in your regex.
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
Another side note: fastcgi_index is meaningless here.
fastcgi_param SCRIPT_FILENAME /home/testing/public_html$fastcgi_script_name;
include /usr/local/nginx/conf/fastcgi_params;
}
Maxim D.
hone
January 14, 2010, 4:30am
3
Thanks, for the tips.
I discovered it was the keys.
If you include the full url in your partials the $uri variable becomes
/full_url
eg
$uri becomes:
/http://thisdomain.com/dssi/&partial=dothis