Servlet的ProxyPass? [英] ProxyPass by servlets?
问题描述
我知道如何使用ProxyPass设置apache服务器.这样客户端可以连接到特定的URL,然后重定向到另一个URL,但是由于他输入的URL仍然存在,因此无法识别.
I know how to set up an apache server with ProxyPass. so that a client can connect to a specific url, is redirected to another url but does not recognize this, as his entered url just remains.
我必须为此使用Apache代理吗?还是可以通过Servlet以某种方式实现相同的结果?尤其是在不更改浏览器URL的情况下进行转发,因此用户仍然认为他直接访问服务器吗?
Do I have to use a apache proxy for this? Or can I somehow achieve the same result with a Servlet? Especially the forwarding without changing the browser url, so the user still thinks he directly accesses the server?
推荐答案
There are probably lots of Proxy Servlets available, some with probably a richer feature-set than Apache's ProxyPass. But you usually want to have a robust server sitting in front of your servlets which is why people setup something like Apache and use ProxyPass to proxy requests to a local (or internal) servlet engine.
您不需要使用Apache.例如,您可以使用 NGinx的ProxyPass 进行几乎相同的操作.如果您担心负载平衡,除了Apache的mod_proxy之外,还有其他模块可以执行此操作.
You don't need to use Apache. For example, you can use NGinx's ProxyPass to do pretty much the same thing. There's also other modules besides Apache's mod_proxy to do this if you're concerned about load balancing.
这篇关于Servlet的ProxyPass?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!