Apache proxy solution 1

Source: Internet
Author: User

From Tangbuhus blog

The company has a backup server that provides asp,. net, php, and jsp all-powerful environments.
Use apache as a proxy. the following error occurs:
Apache reports The following Error: Proxy Error The proxy server has ed an invalid response from an upstream server. the proxy server cocould not handle The request GET/concert/fw/. Reason: Error reading from remote server

I have consulted some materials:

APACHE official Chinese description, about protocol adjustment

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 KeepAlive requests). These two variables are set through the SetEnv command.

The following are examples of force-proxy-request-1.0 and proxy-nokeepalive:

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

So we can modify httpd. conf in this way.

<VirtualHost *: 80>
ServerAdmin asion@mail.com
ServerName www.domain.com
ProxyPass/http: // 192.168.0.92
ProxyPassReverse/http: // 192.168.0.92
SetEnv force-proxies-request-1.0.1
SetEnv proxy-nokeepalive 1
</VirtualHost>
Restart Apache and refresh it N times. Normal !!

If it is a virtual host, modify vhost. conf.

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.