Temporary Redirect 307

Anton Yuzhaninov citrin at citrin.ru
Mon Oct 25 11:23:53 MSD 2010


On 10/25/10 11:05, Igor Janevski wrote:
> Hi, I cannot find anywhere an answer to the following rather simple question .
>
> How can i make a temporary (307) redirect using nginx.
>
> For example i want to have this:
>
>    set $optika PUBLICIP;
>    if ($host != $optika) {
>       rewrite ^/(.*)$ http://$optika/$1 redirect;
>       break;
>    }

rewrite ... redirect
return http 302 and it is temporary redirect.

 From RFC:

10.3.3 302 Found

The requested resource resides temporarily under a different URI. Since the 
redirection might be altered on occasion, the client SHOULD continue to use the 
Request-URI for future requests. This response is only cacheable if indicated by 
a Cache-Control or Expires header field.

Why you need http 307?

-- 
  Anton Yuzhaninov



More information about the nginx mailing list