nginx usptream 302 redirect

Anatoli Marinov a.marinov at ucdn.com
Fri Oct 4 13:20:04 UTC 2013


Where I can ask for a help with this configuration?

I cannot manage to configure it.

My config is as follow:
http {
    proxy_intercept_errors on;

    proxy_cache_path /home/toli/nginx/run/cache keys_zone=zone_c1:256m
inactive=5d max_size=30g;

    upstream up_servers {
        server 127.0.1.1:8081;
    }

    server {
        listen 127.0.0.1:8080;

        location / {
            proxy_cache zone_c1;
            proxy_pass http://127.0.1.1:8081;
            proxy_temp_path tmp ;

            error_page 301 302 307 @redir;
        }

        location @redir {
            proxy_cache zone_c1;
            proxy_pass $upstream_http_location;
            proxy_temp_path tmp ;
       }
    }
}

But I receive 500 internal server error and in the logs I have:
invalid URL prefix in ""
I think the variable $upstream_http_location is empty. Should I use
different variable?


Thanks in advance!


On Wed, Oct 2, 2013 at 3:12 PM, Maxim Dounin <mdounin at mdounin.ru> wrote:

> Hello!
>
> On Wed, Oct 02, 2013 at 03:03:18PM +0300, Anatoli Marinov wrote:
>
> > Hello,
> > Is there an easy way to configure nginx upstream to follow 302 instead of
> > send them to the browser?
>
> The question seems to be off-topic on the nginx-devel@ list.
>
> The answer is yes, but you'll need to configure it carefully
> yourself using the proxy_intercept_errors and error_page 302.
>
> --
> Maxim Dounin
> http://nginx.org/en/donation.html
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20131004/656f08bb/attachment.html>


More information about the nginx-devel mailing list