Does nginx support this function? After forwarding to one tomcat, tomcat returns a redirection to forward to another tomcat.
漂亮男人
漂亮男人 2017-05-16 17:09:53
0
3
589

Does nginx support this function? After forwarding to an application server, the application server finds that it cannot handle the business and needs to forward it to another application server. How can this be achieved?
nginx should support it. It itself can redirect with timeout. It's just that this requires manual redirection.

How to configure and implement it specifically?

漂亮男人
漂亮男人

reply all(3)
世界只因有你

After nginx reverse proxy is forwarded to tomcat, it is up to tomcat to deal with it. Tomcat can directly sendRedirect to another url

Peter_Zhu

Here is an example, you can try it. The general principle is that after proxy_passing to upstream, if the response of upstream is 301 or 302, nginx will use the location in the response header$upstream_http_location取出来,赋值给$saved_redirect_location, and then proxy_pass it again

How to follow HTTP redirects inside nginx?

为情所困

This should not be configured by nginx. The specific configuration should be like this. nginx forwards the request to an application. If the application finds that it cannot handle the request, it will send the request to another application server, and this forwarding should be done by Application initiated.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template