Non-root install of Wordpress in an already running nginx site

Edho Arief edho at
Wed Apr 11 00:02:56 UTC 2012

2012/4/11 Ian M. Evans <ianevans at>:
> Been running nginx on our server for years. php-fpm, multiple location
> sections, etc., all working fine.
> However, for one project we're launching my partner wants to run a
> wordpress blog from a subdirecory, i.e.,
> Can anyone point me to an example of a location block for the wordpress
> blog that handles all the wordpress needs while not futzing with all the
> other locations or causing php problems elsewhere?

location /ournewblog/ {
  root ...;
  try_files $uri /ournewblog/index.php?q=$uri;
  location ~ \.php$ {
    fastcgi_pass ...

Hopefully you don't have regex based location on server { } block.
Otherwise you can try location ~ ^/ournewblog/ instead.

More information about the nginx mailing list