ProxyPassReverse
2013-05-11 15:25
381 查看
The
http://localhost:9013/, and it tries to redirect the browser to, say,
http://localhost:9013/new_location/, and Apache will take this and send it off to the browser. Problem is, the browser (assuming it's somewhere else) then tries to send a request to
http://localhost:9013/new_location/, and gets an error.
What ProxyPassReverse does is intercepts those headers, and rewrites them so that they match what the Apache server that's doing the proxying looks like. So if my apache server is hosting
http://myhost.com/ and I have a
http://localhost:9013/App/new_location/, I'll need to use
If you aren't issuing redirects, it's not going to be an issue, but it doesn't hurt to have it there in case a 301/302 redirect is returned. As far as mod_rewrite, the RewriteRule applies to the request going to the App, and not the response coming from
the App. So they are mutually exclusive events.
ProxyPassReverseis used to change the headers sent by the app (appcluster) to Apache, before Apache sends it the browser. For example, if the app sits at
http://localhost:9013/, and it tries to redirect the browser to, say,
/new_location/, then it will respond with a redirect and location header of
http://localhost:9013/new_location/, and Apache will take this and send it off to the browser. Problem is, the browser (assuming it's somewhere else) then tries to send a request to
http://localhost:9013/new_location/, and gets an error.
What ProxyPassReverse does is intercepts those headers, and rewrites them so that they match what the Apache server that's doing the proxying looks like. So if my apache server is hosting
http://myhost.com/ and I have a
ProxyPassthat points
/to http://localhost:9013/App, if the application sitting at localhost:9013 returns a redirect to
http://localhost:9013/App/new_location/, I'll need to use
ProxyPassReverseso that it gets rewritten to http://myhost.com/new_location/ by Apache before sending the request back to the browser.
If you aren't issuing redirects, it's not going to be an issue, but it doesn't hurt to have it there in case a 301/302 redirect is returned. As far as mod_rewrite, the RewriteRule applies to the request going to the App, and not the response coming from
the App. So they are mutually exclusive events.
相关文章推荐
- ProxyPass与ProxyPassReverse及ProxyPassMatch的概述
- ProxyPass与ProxyPassReverse及ProxyPassMatch的概述
- Apache配置中ProxyPass与ProxyPassReverse的概述
- ProxyPass与ProxyPassReverse及ProxyPassMatch的概述
- ProxyPass与ProxyPassReverse及ProxyPassMatch的概述
- Apache配置中的ProxyPass 和 ProxyPassReverse
- Apache配置中ProxyPass与ProxyPassReverse及ProxyPassMatch的概述
- apache模块mod_proxy中的ProxyPass和ProxyPassReverse
- ProxyPass与ProxyPassReverse及ProxyPassMatch的概述
- ubuntu之apache正向代理及反向代理(ProxyPass\ProxyPassReverse)
- 关于apache模块mod_proxy中ProxyPass和ProxyPassReverse
- ubuntu之apache正向代理及反向代理(ProxyPass\ProxyPassReverse)
- ubuntu之apache正向代理及反向代理(ProxyPass/ProxyPassReverse)
- 【Nginx】关于域名转发proxy_pass
- Nginx配置基础-proxy_pass
- Nginx之 proxy_pass实现代理 小记
- Nginx配置proxy_pass转发的/路径问题
- nginx之proxy_pass代理后端https请求完全拆解
- proxy_pass_request_headers off的坑
- 【nginx】之proxy_pass