`
Hunter_Wang
  • 浏览: 13077 次
  • 性别: Icon_minigender_1
社区版块
存档分类
最新评论

apache proxy error 502错误解决办法

阅读更多

For circumstances where mod_proxy is sending requests to an origin server that doesn't properly implement keepalives or HTTP/1.1, there are two environment variables that can force the request to use HTTP/1.0 with no keepalive. These are set via the SetEnv directive.
These are the force-proxy-request-1.0 and proxy-nokeepalive notes.
译了一下大概是这意思(不是我译的)
引用
当mod_proxy向一个没有正确实现持久连接(KeepAlive)或HTTP/1.1的原始服务器发送请求的时候,可以通过设置两个环境变量来发送不带持久连接(KeepAlive)的HTTP/1.0请求。这两个变量是通过SetEnv指令设置的。
以下是force-proxy-request-1.0和proxy-nokeepalive的例子:

Java代码  收藏代码

    <Location /buggyappserver/> 
      ProxyPass http://buggyappserver:7001/foo/ 
      SetEnv force-proxy-request-1.0 1 
      SetEnv proxy-nokeepalive 1 
    </Location>  


最后在我的httpd.conf的VirtualHost里加上了上面的两行设置
Java代码  收藏代码

    <VirtualHost *:80>  
       JkMount /hr/servlet/* worker1  
       JkMount /hr/*.jsp worker1  
       JkMount /hr/*.do worker1  
       ServerAdmin njgnini@163.com  
       ServerName www.iteye.com  
       ServerAlias www.iteye.com.cn  
       RewriteEngine On  
       RewriteRule ^/$ /hr/ [R,P]        
        
       SetEnv force-proxy-request-1.0.1  
       SetEnv proxy-nokeepalive 1  
    </VirtualHost>

0
1
分享到:
评论

相关推荐

    apache Proxy_Error

    apache Proxy Error apache Proxy Error apache Proxy Error apache Proxy Error

    apache tomcat 反向代理502错误.txt

    apache tomcat 反向代理,http502错误,百度搜的解决不了问题 a.com 可以访问,www.a.com 无法访问http502错误

    apache 采用C语言的模块开发

    发送错误提示页面的程序片断如下: //非法请求作错误跳转 char *location = "/error/error.jsp"; r-&gt;status = HTTP_OK; r-&gt;method = apr_pstrdup(r-&gt;pool, "GET"); r-&gt;method_number = M_...

    apache反向代理

    而在一个繁忙的网站上这一连接数量也许不能满足需要,特别是本文介绍的通过防火墙上的Apache反向代理允许外部用户访问多个内部Web服务器的情况,可以采用更改src/include/httpd.h文件的方法,具体步骤如下。...

    Apache JMeter

    【基本介绍】 Apache JMeter 是100%的Java桌面应用程序。用于对软件做压力测试... 6、Error%: 错误的请求的数量/请求的总数  7、Throughput:每秒完成的请求数  8、KB/Sec: 每秒从服务器端接收到的数据量

    反向代理Nginx

    error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #}...

    Apache中配置支持CORS(跨域资源共享)实例

    当使用ajax跨域请求时,浏览器报错:XmlHttpRequest error: Origin null is not allowed by Access-Control-Allow-Origin.肯定是跨域的问题,如果用jsonp或者proxy的方式进行修改的话未免需要太大的工程量,所以采用...

    pro_apache_third_edition..pdf

    Apache and the Internet..............................................1 Apache: The Anatomy of a Web Server.........................................................1 The Apache Source ....................

    COS——R.log

    at $Proxy59.synchronizeECInfo(Unknown Source) at com.huawei.eidc.tocossoap.EidcSoapBindingImpl.synchronizeECInfo(EidcSoapBindingImpl.java:208) at ...

    Nginx+Tomcat负载均衡

    从网上查了好多资料,多走了很多弯路,现在把自己成功的方法拿出来与大家分享。 Window7 我是在Win7上做的。不是什么Linux,网上好多资料,特别麻烦。 Nginx Nginx 比较好找到,直接去网上下载 网址: ...

    ionic_app:onic应用程式

    ionic_app 技术:AngularJS v1.3.13 + Ionic + Cordova ionic CLI:npm ...ErrorLog "/private/var/log/apache2/dev.local-error_log" CustomLog "/private/var/log/apache2/dev.local-access_log" common Proxy

    shiro入门学习demo源码

    &lt;property name="proxyTargetClass" value="true" /&gt; &lt;/bean&gt; &lt;bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor"&gt; ...

    tomcat8 + nginx + memcached + cas 实现负载均衡的配置包

    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; index index....

    securing_webgoat_using_modsecurity

    ModSecurity is an open source web application firewall that can work either embedded in an Apache web server or as a reverse proxy. The new features in version 2.0 and version 2.5 (released in ...

    超级有影响力霸气的Java面试题大全文档

     Servlet被服务器实例化后,容器运行其init方法,请求到达时运行其service方法,service方法自动派遣运行与请求对应的doXXX方法(doGet,doPost)等,当服务器决定将实例销毁的时候调用其destroy方法。 与cgi的区别...

    Practical Mod Perl

    Apache's mod_proxy Module Section 12.8. mod_rewrite Examples Section 12.9. Getting the Remote Server IP in the Backend Server in the Proxy Setup Section 12.10. Frontend/Backend ...

    logstash-filter-crowd:使用 Atlassian Crowd REST API 查找用户信息的 Logstash 过滤器

    STASH_CAPTCHA %{IP:proxy},%{IP:client} \| %{WORD:error} \| %{WORD:user1} \| %{INT:epoch_time} \| %{WORD:user2} \| (?&lt;error&gt;{%{QS}:%{QS},%{QS}:"For security reasons you must answer a CAPTCHA question....

    Jetty中文手册

    如何配置自定义错误页面(Custom Error Pages) 配置Jetty Statistics(统计) 配置Jetty Statistics教程 配置Request Log教程 Java-monitor 故障排除 如何使用Jetty Dump Feature(特性) Webtide Blog–Jetty ...

    低清版 大型门户网站是这样炼成的.pdf

    7.6.2 文本新闻列表分页控制自定义标签类textnewspagetag 502 7.6.3 图片新闻列表自定义标签类picnewstag 505 7.6.4 幻灯片新闻列表自定义标签类slidenewstag 507 7.6.5 struts2与ajax完全结合实现点击数加一 510...

    java 面试题 总结

    Servlet被服务器实例化后,容器运行其init方法,请求到达时运行其service方法,service方法自动派遣运行与请求对应的doXXX方法(doGet,doPost)等,当服务器决定将实例销毁的时候调用其destroy方法。 与cgi的区别...

Global site tag (gtag.js) - Google Analytics