Welcome! Log In Create A New Profile

Advanced

Temporary Redirect 307

Igor Janevski
October 25, 2010 03:14AM
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;
}

So for example i have:
http://example.com/largefile.mpg

i want to redirect it to:
http://XX.XX.XX.XX/largefile.mpg (which is a faster link but with a
dynamic ip)

the moment the IP is changed the PUBLICIP is updated and the nginx
config is reloaded..
The browsers which already asked for the file will cache it and will
directly try to find via the PUBLICIP which is no longer valid. I need
them to re-ask the example.com again so it gives them the correct
location. I understand that this is done via 307 rather than the default
302 which nginx uses... Do i need to recompile? What if i need both 302
and 307 etc etc....

Thank you very much in advance.

--
------------------------------------------------------------------------
Igor


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Temporary Redirect 307

Igor Janevski October 25, 2010 03:14AM

Re: Temporary Redirect 307

Anton Yuzhaninov October 25, 2010 03:26AM

Re: Temporary Redirect 307

Nicholas Sherlock October 25, 2010 05:52AM

Re: Temporary Redirect 307

Igor Janevski October 25, 2010 05:56AM

Re: Temporary Redirect 307

Nicholas Sherlock October 25, 2010 06:16AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 152
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready