klausi has already posted a nice, actually working nginx configuration for Drupal on his blog. This configuration is intended for Drupal installations installed on separate (sub)domains. However, recently I came up with the need of having multiple Drupal installations in sub-directories for my development environment. To achieve that I've created the following location directive:
That way, you can just add as many Drupal installations as you want in sub-folders, while they are automatically clean-URL enabled. :)
Does not map to production
Running several drupal sites under a same root, is a bad idea IMHO. That's something that made sense in Apache, but which doesn't map to a production setup with nginx.
Instead the easiest way of doing that is using different ports for different sites. That way you only need to change the port and add a server_name directive, possibly also the document root. And you're done: you have a production ready setup.
Also regex based locations are to be avoided whenever possible they're bound to introduce unwanted side effects sooner or later.
for development
As said I'm using it for my development, where this kind of flexibility is useful. Whether its something people want to use on production is another question. Usually you probably won't.
SEO Kerala
Very informative text, thanks for sharing it!
private villas
I love it when people come together and share opinions, great blog, keep it up.
private villas
I love it when people come together and share opinions, great blog, keep it up.
private villas
I love it when people come together and share opinions, great blog, keep it up.