location = / {
rewrite ^ http://site.com/blog/ redirect;
}
Isso apenas fará solicitações especificamente para a raiz. Se você precisar capturar tudo (redirecionar http://site.com/somearticle/something.html
para http://site.com/blog/somearticle/something.html
), precisará de algo mais envolvido:
location /blog/ {
# Empty; this is just here to avoid redirecting for this location,
# though you might already have some config in a block like this.
}
location / {
rewrite ^/(.*)$ http://site.com/blog/$1 redirect;
}