HTTP Proxy error of Apache 502 proxy Error

Source: Internet
Author: User

 

Keyword: Apache
502

Proxy
Error

Recently, when a website was deployed, an error was reported, indicating that HTTP 502 was incorrectly referenced.
Proxy
Error

The proxy
Server received ed an invalid response from an upstream
Server.
The proxy
Server cocould not handle
Request get /.
Reason: Error
Reading from remote
Server

I haven't seen any reason after reading it for a long time. It's just good! After a while, the website can be opened again ....
Check Apache
Access_log. Reference found... Get/
HTTP/1. 0 ....

This is accessed by ie5.5. So I got another ie5.5 server (it's hard to handle it all the time. This is not enough !!) An error occurred. There are other machine access errors. I refreshed it for a while!

In this case, Google found that it was about mod_proxy, and GB of his document.
Http://httpd.apache
. Org/docs/2.3/MoD/mod_proxy.html

Found this paragraph

Reference for circumstances where mod_proxy is sending requests to
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.

This is probably the reference (not translated by me) When mod_proxy sends a request to an original server that does not correctly implement a persistent connection (keepalive) or HTTP/1.1, you can set two environment variables to send HTTP/1.0 requests without keepalive. These two variables are set through the setenv command.

Force-proxy
-Request-1.0 and proxy
-Nokeepalive example:

  1. <Virtualhost *:
    80
    >

  2. Jkmount/HR/servlet/* worker1
  3. Jkmount/HR/*. jsp worker1
  4. Jkmount/HR /*.
    Do
    Worker1
  5. Serveradmin njgnini
    163
    . Com
  6. Servername www.javaeye.com
  7. Serveralias www.javaeye.com.cn
  8. Rewriteengine on
  9. Rewriterule ^/$/HR/[R, p]
  10. Setenv force-proxy
    -Request-
    1.0
    .
    1
     
  11. Setenv proxy
    -Nokeepalive
    1
  12. </Virtualhost>
<VirtualHost *:80>    JkMount /hr/servlet/* worker1    JkMount /hr/*.jsp worker1    JkMount /hr/*.do worker1    ServerAdmin njgnini@163.com    ServerName www.javaeye.com    ServerAlias www.javaeye.com.cn    RewriteEngine On    RewriteRule ^/$ /hr/ [R,P]             SetEnv force-proxy-request-1.0.1    SetEnv proxy-nokeepalive 1 </VirtualHost> 

Restart Apache
Access o from ie5.5

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.