apache代理_简单的Apache代理

apache代理

I was recently working with Apache and a service running on Kris Zyp's Persevere project (which is beyond awesome).  Persevere was pushing messages to my application which was running on Apache; the problem was that Persevere and Apache were running on different ports which technically made them cross-domain.  In order to make the server believe the web service was on the same domain/port, I needed to use Apache proxying.  I opened the conf/httpd.conf file and added the following magic to make that possible:

我最近与Apache和上运行的服务工作克里斯Zyp也的持之以恒的项目(这是超越真棒)。 Persevere正在将消息推送到在Apache上运行的我的应用程序; 问题是Persevere和Apache在不同的端口上运行,这从技术上讲使它们跨域。 为了使服务器相信Web服务位于同一域/端口上,我需要使用Apache代理。 我打开了conf / httpd.conf文件,并添加了以下魔术,使之成为可能:


# Proxy requests to /data to persevere
ProxyPass /service http://localhost:8080/Status
ProxyPassReverse /service/ http://localhost:8080/Status
RewriteRule ^/service$ http://localhost:8080/Status$1 [P,L]


Now any reference to the directory "/Status" is proxied to the other port to receive the data!  Apache proxying is a huge boost to your web application if you can trust the other domain/port.

现在,对目录“ / Status”的任何引用都将代理到另一个端口以接收数据! 如果您可以信任其他域/端口, Apache代理将极大地促进您的Web应用程序。

翻译自: https://davidwalsh.name/apache-proxy

apache代理

你可能感兴趣的:(apache,tomcat,java,nginx,http)