nginx的请求转发和php的header请求跳转原理是一样的吗?

WBOY
Release: 2016-06-06 20:08:11
Original
1227 people have browsed it

这两者都是请求转发吧

回复内容:

这两者都是请求转发吧

如果我理解没错的话,你说的是请求转发和重定向

他们两个有本质的区别,简单解释来说

请求转发客户端是无感知的,比如nginx,php-fpm方式,nginx接受到php的请求,发现自己无法处理,然后就转发给php-fpm处理,然后php-fpm再把处理结果给nginx,nginx再响应给客户端

重定向你可以从客户端的角度简单的理解为发起了两次请求

Nginx转发:
你去火锅店点一份羊肉卷,服务员让后厨切。
你又点了一瓶冰红茶,服务员去吧台小哥那里拿。
就是把服务员帮你把不同的需求分配给不同的人处理,你只跟服务员交流即可。

Header重定向/Js重定向:
你去火锅店,“服务员,来一台法拉利”,服务员把你轰出去,“滚,法拉利4S店在街对面”

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!