Home  >  Q&A  >  body text

Does nginx support this function? After forwarding to one tomcat, tomcat returns a redirection to forward to another tomcat.

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?

漂亮男人漂亮男人2714 days ago512

reply all(3)I'll reply

  • 世界只因有你

    世界只因有你2017-05-16 17:11:53

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

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-16 17:11:53

    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?

    reply
    0
  • 为情所困

    为情所困2017-05-16 17:11:53

    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.

    reply
    0
  • Cancelreply