I'm trying to redirect domain1.com/blog/$ to domain2.com/$. How do I edit this to strip the /blog from the redirect?
location /blog {
rewrite ^/(.*) http://domain2.com/$1 break;
}
It now redirects domain1.com/blog/blabla to domain2.com/blog/blabla (so blog is still there).. Thanks in advance!!
rewrite ^/blog/(.*) http://domain2.com/$1 break;
(in which case, you might also be able to get rid of the location block).