Articles of mod proxy

根据另一个请求头的值在mod_proxy上添加一个请求头

我有一个运行mod_proxy的服务器,我需要重新命名一个请求头。 接近原点的代理将剥离X-Forwarded-For标题,但是我们需要这些数据来保存,所以我想将该值添加到不同的标题以允许原点将其提取出来。 从我阅读的DOCO没有办法重新命名一个头,我不明白如何将值传递到RequestHeader添加在mod_headers。

麻烦configurationApache服务器代理SSL连接

我正在Apache Portable Runtime上运行Tomcat7上的应用程序,我购买了SSL证书并正确configuration了它 – 当我尝试通过ip:port组合连接时,它连接正常,但是警告我证书颁发给了域名,不是IP。 我正在使用的VPS没有安装SELinux(有安装问题),这是AFAIK要求在Apache中configurationSSL,所以我只想将请求路由到Tomcat,它在它的末尾。 我configuration了Apache来代理连接,首先使用端口80,完美的工作: NameVirtualHost www.mysite.com:80 <VirtualHost www.mysite.com:80> ProxyPreserveHost On ProxyRequests Off ServerName http://www.mysite.com ServerAlias http://www.mysite.com ProxyPass / http://localhost:8180/MYSITE/ ProxyPassReverse / http://localhost:8180/MYSITE/ ProxyPassReverseCookiePath /MYSITE/ / </VirtualHost> 然后用不想工作的SSL端口出于某种原因: NameVirtualHost www.mysite.com:443 <VirtualHost www.mysite.com:443> SSLProxyEngine On ProxyPreserveHost On ProxyRequests Off ServerName https://www.mysite.com ServerAlias https://www.mysite.com ProxyPass / https://localhost:8443/MYSITE/ ProxyPassReverse / https://localhost:8443/MYSITE/ ProxyPassReverseCookiePath /MYSITE/ / CacheDisable * […]

Apache mod_proxy_balancer健康检查

我有3个Apache Web服务器设置在另一个运行mod_proxy_balancer的Apache服务器之后。 在今天,其中一个networking服务器重新启动。 大约需要16分钟才能重新启动。 在此期间,我可以在我的Apache mod_proxy_balancer服务器上的错误日志中每隔30秒看到以下日志行 [Tue Sep 30 07:04:42 2014] [error] ap_proxy_connect_backend disabling worker for (s1-sc1-c-use) 在16分钟的停电期间,这被logging了32次 我正在试图弄清楚这里发生了什么事情。 我担心的是,由于我的平衡器configuration不足,平衡器反复尝试向重新启动服务器发送请求(并因此将错误返回给用户)。 为什么Apache一再告诉我这是“禁用工人”? 平衡器模块是否间歇地将用户请求发送到发生故障的节点,尝试确定是否备份,或者是否有自己的内部健康检查机制,这对用户是不可见的?

Moodle只服务于IP – 不会与mod_proxy一起使用

我试图在一个已经通过Apache服务Plone&Trac的Ubuntu盒子上设置一个moodle服务器。 在我的Moodleconfiguration中,我有$ CFG-> wwwroot =' http://www.server-name.org/moodle ' 下面的(错综复杂的,但工作)configuration工作正常,但是当我访问www.server-name.com/moodle时,我得到: 检测到不正确的访问,只能通过“ http://xxx.xxx.xxx.xxx:8888/moodle ”地址访问此服务器,对不起 然后转发到Moodle运行正常的IP地址。 我错过了什么让服务器名称方法正常工作? Apacheconfiguration如下: LoadModule transform_module /usr/lib/apache2/modules/mod_transform.so Listen 8080 Listen 8888 Include /etc/phpmyadmin/apache.conf <VirtualHost xxx.xxx.xxx.xxx:8080> <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPreserveHost On <Location /> ProxyPass http://127.0.0.1:8082/ ProxyPassReverse http://127.0.0.1:8082/ </Location> </VirtualHost> <VirtualHost xxx.xxx.xxx.xxx:80> ServerName www.server-name.org ServerAlias server-name.org ProxyRequests Off FilterDeclare MyStyle RESOURCE FilterProvider […]

连接拒绝在SSH隧道到Apache转发代理设置

我正在尝试在小型服务器中设置一个私人转发代理。 我的意思是在会议期间使用它来通过ssh隧道将我的互联网访问隧道到代理服务器。 所以我在apache-2.2内部创build了一个虚拟主机,运行代理,proxy_http和proxy_connect模块。 我使用这个configuration: <VirtualHost localhost:8080> ServerAdmin xxxxxxxxxxxxxxxxxxxx ServerName yyyyyyyyyyyyyyyyyyyy ErrorLog /var/log/apache2/proxy-error_log CustomLog /var/log/apache2/proxy-access_log combined <IfModule mod_proxy.c> ProxyRequests On <Proxy *> # deny access to all IP addresses except localhost Order deny,allow Deny from all Allow from 127.0.0.1 </Proxy> # The following is my preference. Your mileage may vary. ProxyVia Block ## allow SSL proxy […]

mod_proxy映射http:// myserver /游戏到http:// localhost:5732 /?

N00b的问题。 我有一个url http://myserver.com/game 并想调用内部资源 http://localhost:5732/ 我试过了: AllowCONNECT 5732 ProxyPass /game/ http://localhost:5732/ nocanon ProxyPassReverse /game/ http://localhost:5732/ 但回来的HTML包含的链接没有得到/游戏/ prepended和JS和CSS中断。 所以我试了一下: RewriteEngine On RewriteRule ^/game(.*) http://localhost:5732$1 但是发送redirect(当然不起作用)到浏览器。 我错了什么? 我的目标是: http://myserver/game –> http://localhost:5732/ 非常感谢帮助

无法configurationApache以限制IP代理访问

我在httpd.conf中添加了以下内容(在VirtualHost之后): <VirtualHost *:80> ServerName XXX.XXX.XXX <Directory proxy:> Order allow,deny Allow from 10.52.208.221 Allow from 10.52.208.223 Deny from all </Directory> ProxyPass / http://XXX.XXX.XXX/ RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^/admin/$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] </VirtualHost> 但是,我可以从其他IP访问我的VirtualHost: # cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.4 (Santiago) # uname -a Linux XXXXX.XXXXX.XXX 2.6.32-358.18.1.el6.x86_64 #1 SMP Fri Aug 2 […]

mod_rewrite不添加REDIRECT_URL环境variables

我们运行一个基于Zend框架的站点,使用Apache httpd(2.2)和mod_rewrite进行SEO和可用性友好的URL:s。 最近我们添加了mod_proxy (和mod_proxy_balancer, mod_proxy_http, mod_rpaf )来设置负载均衡器虚拟主机。 我们的设置现在看起来像: external.site.com (vhost on server1.site.com with reverse proxy) |-internal1.site.com (vhost on server1.site.com) |-internal2.site.com (vhost on server2.site.com) 其中internal1和internal2服务大部分dynamic内容, external服务静态内容加上一些pipe理员types页面。 所有的虚拟主机都有相同的代码和.htaccess设置。 问题是,在external.site.com RewriteRule不会正确的头添加到请求环境,特别是我们和ZendFramework依赖的REDIRECT_URL 。 一切工作正常转发给内部虚拟主机的请求。 httpd.conf的相关部分: <VirtualHost *:80> ServerName external.site.com DocumentRoot /opt/www/htdocs/ CustomLog "/var/log/httpd-proxy-access.log" combined <Proxy balancer://backend/> Balancermember http://internal1.site.com Balancermember http://internal2.site.com ProxySet lbmethod=byrequests </Proxy> ProxyRequests Off <Proxy *> Order deny,allow […]

lighttpd和mod_proxy与PHP

我正在尝试使用lighttpd,一些自定义Ruby代理,rails / ramaze(在Thin上运行)和PHP的组合来创build相当复杂的设置。 目前它是这样设置的: 浏览器发出点击lighttpd前端的请求。 lighttpd是用mod_proxy设置的,将这个请求路由到我自定义devise的许多Ruby代理之一。 proxy.balance = "fair" proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => 9090 ), ( "host" => "127.0.0.1", "port" => 9091 ) ) ) 该请求被转发到其中一个Ruby进程,然后打开一个新的连接到运行应用程序的许多瘦实例之一。 它使用了一些负载均衡魔术以及一组networking服务器。 瘦实例生成页面,将其发送回代理,代理将该页面发回给lighttpd,由lighttpd将其提供给浏览器。 我的问题是,鉴于上述体系结构,将PHP支持添加到此群集中的最佳方式是什么? PHP需要在Ruby代理之后运行,这样我就可以区分PHP和Ruby请求,并将它们路由到正确的位置,但是我找不到适用于PHP的精简型服务器。 我应该手动启动群集上的php-cgi,然后添加FCGI支持到我的Ruby代理? 还是应该在每台服务器上启动一个新的lighttpd实例来专门生成PHP页面(我觉得这与使用Ruby的瘦模型最接近,但是担心开销和缺乏控制)。 请记住,每个应用程序都需要入侵它自己的* nix帐户,一些应用程序在多个服务器上占用10多个帐户。 我还需要一种方法来正确地限制PHP应用程序使用的服务器资源的数量(也许通过每个* nix acount启动一个或两个php-cgi实例?)。

使mod_proxy_httpasynchronous发回响应(无100继续)

Servlet引擎(Jetty)运行在Apache Httpd服务器后面,使用mod_proxy_http转发。 这是运行一个小的servlet,它接受PUT请求,并使用HTTP基本authentication(在Jetty中处理)进行authentication。 使用curl执行直接(非代理)的PUT请求时,使用错误的身份validation凭据,服务器将按预期方式返回401状态码: curl -v -T testfile -u user:WRONG_PASSWORD http://localhost:8080/myservlet/ 这样一旦收到状态码就中断请求,所以curl不会全部上传,而是提前停止( HTTP error before end of send, stop sending )。 * About to connect() to localhost port 8080 (#0) * Trying 127.0.0.1… connected * Server auth using Basic with user 'user' > PUT /myservlet/testfile HTTP/1.1 > Authorization: Basic xxxxxxxxxxxxxxxxx > User-Agent: curl/7.22.0 > Host: […]