Preferred way to do redirects (rewrite or return)

justin nginx-forum at
Mon Sep 23 20:38:53 UTC 2013

What is the preferred way to do redirects? I know of two solutions:

rewrite "^/help/?$" permanent;


location ^/help/?$ {
  return 301;

I think I like using a location block and a return statement. Which is
faster though and the standard?

Posted at Nginx Forum:,243075,243075#msg-243075

More information about the nginx mailing list