Does nginx request forwarding share the same principle as php header request redirection?

Source: Internet
Author: User
Both are request-based forwarding. Both are request-based forwarding.

Reply content:

Both are request forwarding.

If I understand it correctly, you are talking about request forwarding and redirection.

There are two essential differences between them.

Request forwardingThe client is imperceptible. For example, in nginx or php-fpm mode, nginx receives requests from php and finds that it cannot be processed by itself, and then forwards the requests to php-fpm for processing, then php-fpm sends the processing result to nginx, and nginx then responds to the client.

RedirectionFrom the client perspective, you can simply understand that two requests are initiated.

Nginx forwarding:
You go to the hot pot restaurant and order a mutton slice. The waiter cut the slice.
You ordered another bottle of ice black tea, and the waiter went to the bar to get it.
It is to assign different requirements to different people for help from the waiter. You only need to communicate with the waiter.

Header redirection/Js redirection:
You go to the hot pot restaurant, "Waiter, come to a Ferrari", the waiter blew you out, "Roll, Ferrari 4S shop across the street"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.