I have followed all the instructions in the wiki, and when i set my
drupal
installations as the root, everything works, however, when i move my
drupal
into a folder i am able to get everything to work except clean urls.
Here is my drupal config:
location /blog {
# This is cool because no php is touched for static
content
try_files $uri @rewrite;
}
location @rewrite {
# You have 2 options here
# For D7 and above:
# Clean URLs are handled in
drupal_environment_initialize(). #rewrite ^ /blog/index.php;
# For Drupal 6 and bwlow:
# Some modules enforce no slash (/) at the end of the
URL
# Else this rewrite block wouldn’t be needed
(GlobalRedirect)
rewrite ^blog/(.*)$ blog/index.php?q=$1;
}
location ~ blog/.*\.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
#NOTE: You should have "cgi.fix_pathinfo = 0;" in
# Fighting with Styles? This little gem is amazing.
# This is for D6
#location ~ ^/sites/.*/files/imagecache/ {
# This is for D7 and D8
location ~ ^/blog/sites/.*/files/styles/ {
try_files $uri @rewrite;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
Here is the error i am seeing in my log:
[error] 12988#0: *1 open() “/var/www/html/blog/linux” failed (2: No such
file or directory), client: 192.168.1.1, server: localhost, request:
“GET
/blog/linux HTTP/1.1”, host: “example.com”, referrer:
“http://example.com/blog/”
That line probably does nothing useful. There aren’t many urls that
both end in “.php” and contain the string “.php/”. Something like
/blog/one.php/two.php would match – but does your drupal use urls
like that?
Here is the error i am seeing in my log:
[error] 12988#0: *1 open() “/var/www/html/blog/linux” failed (2: No such
file or directory), client: 192.168.1.1, server: localhost, request: “GET
/blog/linux HTTP/1.1”, host: “example.com”, referrer:
“http://example.com/blog/”
I suspect that if you turned on the debug log, you’d see what rewrites
were actually used; and you could match that against what you expect
nginx to do.
But the blog → /blog change may be enough to get things going.
Changing the rewrite from blog to /blog worked perfectly – thanks for
the
second set of eyes
I’m not sure on the busy-work part – i took most of the stuff from the
nginx wiki on drupal (still learning config files, been running nginx
for
about 24 hours now)
Posted at Nginx Forum:
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.