<-
Apache > HTTP Server > �ĵ� > �汾2.2 > ģ��
���� ��л | �������� | ��ƪ���ߣ��𲽹� | ��ƪ��������£�?��?��?�� | ��ȡ���°汾

Apacheģ�� mod_proxy

˵���ṩHTTP/1.1�Ĵ���/���ع���֧��
״̬��չ(E)
ģ����proxy_module
Դ�ļ�mod_proxy.c

����

����

����û�жԷ�������ȡ��ȫ��ʩ֮ǰ���벻Ҫ��ProxyRequests���ô���һ�����ŵĴ��������������������������в����������������˵Ҳͬ����ˡ�

��ģ��ʵ����Apache�Ĵ���/���ء���ʵ�������¹淶�Ĵ���AJP13(Apache JServe Protocol v1.3), FTP, CONNECT(����SSL), HTTP/0.9, HTTP/1.0, HTTP/1.1 ����ģ�龭���ú��������������Э��������������ģ�顣

Apache�Ĵ�����(��mod_proxy����)�����ֵ��˼�����ͬ��ģ���У�mod_proxy_http, mod_proxy_ftp, mod_proxy_ajp, mod_proxy_balancer, mod_proxy_connect �������������ʹ��һ�����������ܣ��ͱ��뽫mod_proxy����Ӧ��ģ��ͬʱ���ص���������(��̬���ӻ���LoadModule��̬����)��

���⣬����ģ�黹�ṩ����չ���ԡ�mod_cache�������ģ���ṩ�˻������ԡ�mod_ssl�ṩ��SSLProxy*ϵ��ָ�����ʹ��SSL/TLS����Զ�̷���������Щ�ṩ��չ���Ե�ģ������ڱ���ȷ���غ������Ժ�����ṩ��Щ��չ���ܡ�

top

����ͷ������

Apache���Ա�����Ϊ����(forward)������(reverse)����

���������һ��λ�ڿͻ��˺�ԭʼ������(origin server)֮��ķ�������Ϊ�˴�ԭʼ������ȡ�����ݣ��ͻ����������һ������ָ��Ŀ��(ԭʼ������)��Ȼ�������ԭʼ������ת�����󲢽���õ����ݷ��ظ��ͻ��ˡ��ͻ��˱���Ҫ����һЩ�ر�����ò���ʹ���������

�������ĵ�����;��Ϊ�ڷ���ǽ�ڵľ������ͻ����ṩ����Internet��;���������������ʹ�û�������(��mod_cache�ṩ)��������ʹ���ʡ�

ʹ��ProxyRequestsָ��ɼ������������Ϊ�����������ͻ���ͨ��������������վ�������ؿͻ�����������������ȡ��ȫ��ʩ��ȷ����Ϊ������Ȩ�Ŀͻ����ṩ����

������������෴�����ڿͻ��˶�����������ԭʼ�����������ҿͻ��˲���Ҫ�����κ��ر�����á��ͻ��������������ֿռ�(name-space)�е����ݷ�����ͨ���󣬽��ŷ�������ж���δ�(ԭʼ������)ת�����󣬲�����õ����ݷ��ظ��ͻ��ˣ�������Щ����ԭ���������Լ���һ����

�������ĵ�����;�ǽ�����ǽ����ķ������ṩ��Internet�û����ʡ������������Ϊ��˵Ķ�̨�������ṩ����ƽ�⣬��Ϊ��˽����ķ������ṩ����������⣬���������ø߼�URL���Ժ͹��������Ӷ�ʹ���ڲ�ͬweb������ϵͳ��webҳ��ͬʱ������ͬһ��URL�ռ��¡�

����ʹ��ProxyPassָ�������(��RewriteRuleָ����ʹ��[P]���Ҳ����)�����÷����������Ҫ��ProxyRequestsָ�

top

��ʾ��

��������ӽ�����Ϊ�˸���һ������������������Ŷ��ѣ�����ϸ�Ķ�ÿ��ָ����ĵ���

���⣬�����ʹ�û������ԣ���鿴mod_cache�ĵ���

�������

ProxyRequests On
ProxyVia On

<Proxy *>
Order deny,allow
Deny from all
Allow from internal.example.com
</Proxy>

�������

ProxyRequests Off

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPass /foo http://foo.example.com/bar
ProxyPassReverse /foo http://foo.example.com/bar

top

���ƶԴ���������ķ���

������ͨ��<Proxy>����ֹ����������˭�ܷ������Ĵ���ʾ�����£�

<Proxy *>
Order Deny,Allow
Deny from all
Allow from 192.168.0
</Proxy>

Ҫ�˽������ʿ�����Ϣ����μ�mod_authz_host�ĵ���

ʹ���������ʱ�ϸ���Ʒ���Ȩ��(ʹ��ProxyRequestsָ��)�Ƿdz���Ҫ�ġ�������Ĵ���ᱻ�ͻ������������������������������ؿͻ��˵���ʵ��ݡ��ⲻ����������������в����������������˵Ҳͬ����ˡ���ʹ�÷������(��"ProxyRequests Off"������ʹ��ProxyPassָ��)��ʱ����ʿ���Ҫ��Կ��ɣ���Ϊ�ͻ���ֻ�����������õ��ض�������

top

��������

�����ʹ����ProxyBlockָ�����������ʱ���Ҳ�������������IP��ַ�Ա���̵�ƥ�����ʹ�á��⽫�Ứ�Ѽ���������ʱ�䣬����Ҫȡ�������������ҵ��ٶȡ�

top

����������

λ�ھ������ڵ�Apache�����������Ҫ���ɹ�˾�ķ���ǽת�����ⲿ������(ʹ��ProxyRemoteָ��������)�����������ʾ������ڵ���Դʱ������Խ������ǽֱ�ӷ���Ŀ���������ڷ���һ�����ھ������ķ������Ӷ�����ֱ������ʱ��NoProxyָ��ͻ�����á�

�������ڵ��û�ϰ���ڲ������ǵ�WWW�����м��뱾��������ƣ����ǻ�ʹ��"http://somehost/"��ȡ��http://somehost.example.com/ ��һЩ��ҵ����������᲻����Щ��ֻ�Dz��ñ�������������򵥵��ŷ�������󡣵�ʹ����ProxyDomainָ����Ϊ������������һ���������ʱ��Apache�ᷢ��һ���ض���Ӧ����ʹ�ͻ������󵽴���ȷ�ġ�������Ҫ��ķ�������ַ����Ϊ����һ�����û�����ǩ�ļ��ͻ���֮����������������������������ѡ�ķ�����

top

�����

��mod_proxy��һ��û����ȷʵ�ֳ־�����(KeepAlive)��HTTP/1.1��ԭʼ���������������ʱ�򣬿���ͨ�����������������������Ͳ����־�����(KeepAlive)��HTTP/1.0����������������ͨ��SetEnvָ�����õġ�

������force-proxy-request-1.0��proxy-nokeepalive�����ӣ�

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

top

������

һЩ���󷽷�(��POST)����һ�������塣HTTPЭ��Ҫ�������������������ʹ�ÿ鴫�����(chunked transfer encoding)���߰���һ��Content-Length����ͷ�������������󴫵ݸ�ԭʼ��������ʱ��mod_proxy_http��ʼ�ճ���ʹ��Content-Length����ͷ�������ԭʼ����ʹ�õ��ǿ���룬��ô�����Ҳͬ�����������������󡣿���ʹ������������������ѡ������proxy-sendcl����ȷ��ʼ�շ���Content-Lengthͷ�������η������������̶ȵļ����ԣ�������proxy-sendchunked����ͨ������ʹ�ÿ�����Ծ�������С����Դռ���ʡ�

top

AllowCONNECT ָ��

˵��ͨ����������CONNECT�Ķ˿ں�
�﷨AllowCONNECT port [port] ...
Ĭ��ֵAllowCONNECT 443 563
������server config, virtual host
״̬��չ(E)
ģ��mod_proxy

AllowCONNECTָ��ָ���˴˴����CONNECT�����������ӵĶ˿ں��б������������ڽ���https��������ʱʹ�����ַ�����������Ĭ�ϻὫ��תΪhttp��

Ĭ��ֻ������Ĭ�ϵ�https�˿�(443)��Ĭ�ϵ�snews�˿�(563)��ʹ��AllowCONNECTָ����Ը���Ĭ�����ö���Ϊ�����������г��Ķ˿ڡ�

ע�⣬����ȷ��mod_proxy_connectҲͬʱ�����ڷ������У���������֧��CONNECT ��

top

NoProxy ָ��

˵��ֱ�ӽ������ӵ�����/��/����
�﷨NoProxy host [host] ...
������server config, virtual host
״̬��չ(E)
ģ��mod_proxy

��ָ��������ھ������ڵ�Apache�����������NoProxyָ��ָ����һ���м��Կո�ָ���������IP��ַ��������/������б���ij��ƥ������һ�������б��������������ֱ�ӱ����ŷ�������ת�������úõ�ProxyRemote�����������

ʾ��

ProxyRemote * http://firewall.mycompany.com:81
NoProxy .mycompany.com 192.168.112.0/21

NoProxyָ���host��������������ѡ��֮һ��

��

����һ��DNS������һ���֣�����ǰ����ϵ�š�����ʾһ���߼�������ͬһ��DNS�����������Ҳ����������Щ������������ͬ�ĺ�׺�������"��׺"��������

����

.com
.apache.org.

����������(һ��DNS������Ҳ������һ��DNS"A��¼"!)�IJ�֮ͬ��������ʼ����һ��ǰ���㡣

ע��

���������ִ�Сд����ʼ����Ϊ��ê����DNS�����ϵģ����.MyDomain.com��.mydomain.com.(ע���β���)����ȫ��ͬ�ġ���Ϊ��ıȽϲ���Ҫ����DNS��ѯ��������������Ƚϸ��Ӹ�Ч��

����

�����Ե��ʮ������ʽ��ʾ��һ����������ַ��һ���֣���ʱ�����һ��б�ܺ��������룬��ָ�������е���Чbitλ�������ڱ�ʾ����ͨ���������ͨ����ӿڿ��Է��ʵ�������Χ��δָ�����������ʱ��ͼٶ����Ե���(��Ϊ���)��β���־������룬����������£�����bit���ȱ�����8bit�������������磺

192.168��192.168.0.0
����"192.168.0.0"��ʾ����Ϊ16bit(��ʱҲ��255.255.0.0��ʾ)��
192.168.112.0/21
����"192.168.112.0/21"��ʾ����Ϊ21bit(��ʱҲ��255.255.248.0��ʾ)��

���˻������޵�����£�һ������Ϊ32bit�������͵ȼ���һ��IP��ַ��������Ϸ�bit������("0.0.0.0/0")�ȼ��ڳ���"_Default_"������ƥ���κ�IP��ַ��

IP��ַ

IP��ַ�Ե��ʮ������ʽ��ʾ��һ����������������ַ��һ����˵���˵�ַ����һ����������������Ҫһ��DNS�����������ַ��Ӧ��

ʾ��

192.168.123.7

ע��

һ��IP��ַ����ҪΪһ��DNSϵͳ����������������ʹapache��ȡ�������ܡ�

������

��������һ��������DNS����������ͨ��DNS�����������Ϊһ������IP��ַ����������һ���߼�����(�����෴)���ұ������������һ��IP��ַ(�򾭳������ɾ��в�ͬIP��ַ�������б�)��

����

prep.ai.mit.edu
www.apache.org

ע��

�ںܶ�����£�ָ��һ��IP��ַ���������������Ч�ʡ���Ϊ���Ա���һ��DNS��ѯ����ʹ��һ�����ٵ�PPP����������������ʱ��Apache�����������Ứ���൱�ɹ۵�ʱ�䡣

�����������ִ�Сд����ʼ����Ϊ��ê����DNS�����ϵģ����WWW.MyDomain.com��www.mydomain.com.(ע���β���)����ȫ��ͬ�ġ�

�μ�

top

<Proxy> ָ��

˵��Ӧ������������Դ������
�﷨<Proxy wildcard-url> ...</Proxy>
������server config, virtual host
״̬��չ(E)
ģ��mod_proxy

λ��<Proxy>���ö��е�ָ���������ƥ��Ĵ������ݡ�����п���ʹ��shell����ͨ�����

����˵������������yournetwork.example.com�е�����ͨ�����Ĵ�����������ʴ������ݣ�

<Proxy *>
Order Deny,Allow
Deny from all
Allow from yournetwork.example.com
</Proxy>

������������example.com��fooĿ¼�µ��ļ�ͨ���������������֮ǰ��INCLUDES���������д���

<Proxy http://example.com/foo/*>
SetOutputFilter INCLUDES
</Proxy>

top

ProxyBadHeader ָ��

˵��ȷ����δ����Ϸ���Ӧ��ͷ
�﷨ProxyBadHeader IsError|Ignore|StartBody
Ĭ��ֵProxyBadHeader IsError
������server config, virtual host
״̬��չ(E)
ģ��mod_proxy
���������� Apache 2.0.44 ���Ժ�İ汾�п���

ProxyBadHeaderָ�����mod_proxy��δ����Ϸ���Ӧ��ͷ(���綪ʧð��(:))��������ȡֵ��Χ���£�

IsError
��"502"(Bad Gateway)Ӧ����ֹ��������Ĭ����Ϊ��
Ignore
���ԣ��������Dz�����һ����
StartBody
�ڽ��յ���һ���Ƿ�ͷ��ʱֹͣ��ȡͷ������ʣ�ಿ�ֵ���Ӧ���塣�����������ں�һ�����淶�ġ�����������Ӧ��ͷ��Ӧ����֮�������еĺ�˷�����Эͬ������
top

ProxyBlock ָ��

˵�����ñ��������ε���䡢��������
�﷨ProxyBlock *|word|host|domain [word|host|domain] ...
������server config, virtual host
״̬��չ(E)
ģ��mod_proxy

ProxyBlockָ��ָ����һ���ɿո�ָ�����䡢������/������б�������ƥ����Щ��䡢������/�����HTTP��HTTPS��FTP�ĵ������󶼽���������������������ģ�����������ʱ����ȷ���б��п���������������Ŀ��Ӧ��IP��ַ�������仺������ƥ����ԡ�����˵��

ʾ��

ProxyBlock joes-garage.com some-host.co.uk rocky.wotsamattau.edu

ͨ��IP��ַ��rocky.wotsamattau.edu������ͬ����ƥ�䡣

��ע�⣬wotsamattau�Ѿ��㹻ƥ��wotsamattau.edu�ˡ�

��ע��

ProxyBlock *

�����ζ�����վ������ӡ�

top

ProxyDomain ָ��

˵�����������Ĭ������
�﷨ProxyDomain Domain
������server config, virtual host
״̬��չ(E)
ģ��mod_proxy

��ָ�����λ�ھ������ڵ�Apache������������á�ProxyDomainָ��ָ����apache���������������Ĭ�������������һ����û�����������������󣬾ͻ���������Զ�����һ��������Domain���ض���Ӧ��

ʾ��

ProxyRemote * http://firewall.mycompany.com:81
NoProxy .mycompany.com 192.168.112.0/21
ProxyDomain .mycompany.com

top

ProxyErrorOverride ָ��

˵�����Ǵ������ݵĴ���ҳ
�﷨ProxyErrorOverride On|Off
Ĭ��ֵProxyErrorOverride Off
������server config, virtual host
״̬��չ(E)
ģ��mod_proxy
���������� Apache 2.0 ���Ժ�İ汾�п���

��ָ�����ڷ����������������Ϊ�����û��ṩ�۸�һ�µĴ���ҳ��ʱ����Ҳͬ����������ļ�(ͨ��mod_include��SSI)��ȡ����Ų�������Ӧ�Ķ�����(Ĭ����Ϊ����ʾ������ķ������Ĵ���ҳ�棬������Ŀ��Ϊ"On"����ʾSSI������Ϣ��)

top

ProxyIOBufferSize ָ��

˵���ڲ���������С
�﷨ProxyIOBufferSize bytes
Ĭ��ֵProxyIOBufferSize 8192
������server config, virtual host
״̬��չ(E)
ģ��mod_proxy

ProxyIOBufferSizeָ�����ڵ����ڲ�������(��Ϊ����������ݵ��ݴ���)�Ĵ�С��ȡֵ����С�ڵ���8192 ��

�ھ����������£�����Ҫ����������á�

top

<ProxyMatch> ָ��

˵��Ӧ����ƥ��������ʽ�Ĵ�����Դ������
�﷨<ProxyMatch regex> ...</ProxyMatch>
������server config, virtual host
״̬��չ(E)
ģ��mod_proxy

<ProxyMatch>��<Proxy>ָ�������ͬ��ֻ��ƥ���ַ�������Ϊ������ʽ��

top

ProxyMaxForwards ָ��

˵��ת���������������Ŀ
�﷨ProxyMaxForwards number
Ĭ��ֵProxyMaxForwards 10
������server config, virtual host
״̬��չ(E)
ģ��mod_proxy
���������� Apache 2.0 ���Ժ�İ汾�п���

ProxyMaxForwardsָ��ָ��������ת���������������Ŀ�����������Ϊ�˱������޴���ѭ����DoS�����ķ�����

ʾ��

ProxyMaxForwards 15

top

ProxyPass ָ��

˵����һ��Զ�˷�����ӳ�䵽���ط�������URL�ռ���
�﷨ProxyPass [path] !|url [key=value key=value ...]]
������server config, virtual host, directory
״̬��չ(E)
ģ��mod_proxy

��ָ�������㽫һ��Զ�˷�����ӳ�䵽���ط�������URL�ռ��У���ʱ���ط����������䵱�����ɫ�����dz䵱Զ�̷�������һ������path��һ����������·������url��һ��ָ��Զ�̷������IJ���URL�����Ҳ����������ѯ�ַ�����

��ʹ��ProxyPassָ��ʱ��ProxyRequestsָ��ͨ��Ӧ������Ϊ off ��

���豾�ط�������ַ�ǣ�http://example.com/ ����ô��

ProxyPass /mirror/foo/ http://backend.example.com/

���ᵼ�¶�http://example.com/mirror/foo/bar�ı������󽫻����ڲ�ת��Ϊһ����������http://backend.example.com/bar ��

"!"ָ������������ij����Ŀ¼���з������ʱ�����á�����˵��

ProxyPass /mirror/foo/i !
ProxyPass /mirror/foo http://backend.example.com

��������/mirror/foo/i֮������ж�backend.example.com��/mirror/foo������

ע��

˳�����Ҫ������Ҫ�Ѿܾ�ָ���������ͨProxyPassָ��֮ǰ��

As of Apache 2.1, the ability to use pooled connections to a backend server is available. Using the key=value parameters it is possible to tune this connection pooling. The default for a Hard Maximum for the number of connections is the number of threads per process in the active MPM. In the Prefork MPM, this is always 1, while with the Worker MPM it is controlled by the ThreadsPerChild.

Setting min will determine how many connections will always be open to the backend server. Upto the Soft Maximum or smax number of connections will be created on demand. Any connections above smax are subject to a time to live or ttl. Apache will never create more than the Hard Maximum or max connections to the backend server.

ProxyPass /example http://backend.example.com smax=5 max=20 ttl=120 retry=300

ParameterDefaultDescription
min0Minumum number of connections that will always be open to the backend server.
max1...nHard Maximum number of connections that will be allowed to the backend server. The default for a Hard Maximum for the number of connections is the number of threads per process in the active MPM. In the Prefork MPM, this is always 1, while with the Worker MPM it is controlled by the ThreadsPerChild. Apache will never create more than the Hard Maximum connections to the backend server.
smaxmaxUpto the Soft Maximum number of connections will be created on demand. Any connections above smax are subject to a time to live or ttl.
ttl-Time To Live for the inactive connections above the smax connections in seconds. Apache will close all connections that has not been used inside that time period.
timeoutTimeoutConnection timeout in seconds. If not set the Apache will wait until the free connection is available. This directive is used for limiting the number of connections to the backend server together with max parameter.
acquire-If set this will be the maximum time to wait for a free connection in the connection pool. If there are no free connections in the pool the Apache will return SERVER_BUSY status to the client.
keepaliveOffThis parameter should be used when you have a firewall between your Apache and the backend server, who tend to drop inactive connections. This flag will tell the Operating System to send KEEP_ALIVE messages on inactive connections (interval depends on global OS settings, generally 120ms), and thus prevent the firewall to drop the connection. To enable keepalive set this property value to On.
retry60Connection pool worker retry timeout in seconds. If the connection pool worker to the backend server is in the error state, Apache will not forward any requests to that server until the timeout expires. This enables to shut down the backend server for maintenance, and bring it back online later.
loadfactor1Worker load factor. Used with BalancerMember. It is a number between 1 and 100 and defines the normalized weighted load applied to the worker.
route-Route of the worker when used inside load balancer. The route is a value appended to seesion id.
redirect-Redirection Route of the worker. This value is usually set dynamically to enable safe removal of the node from the cluster. If set all requests without session id will be redirected to the BalancerMember that has route parametar equal as this value.

If the Proxy directive scheme starts with the balancer:// then a virtual worker that does not really communicate with the backend server will be created. Instead it is responsible for the management of several "real" workers. In that case the special set of parameters can be add to this virtual worker.

ParameterDefaultDescription
lbmethod-Balancer load-balance method. Select the load-balancing scheduler method to use. Either byrequests, to perform weighted request counting or bytraffic, to perform weighted traffic byte count balancing. Default is byrequests.
stickysession-Balancer sticky session name. The value is usually set to something like JSESSIONID��PHPSESSIONID, and it depends on the backend application server that support sessions.
nofailoverOffIf set to On the session will break if the worker is in error state or disabled. Set this value to On if backend servers do not support session replication.
timeout0Balancer timeout in seconds. If set this will be the maximum time to wait for a free worker. Default is not to wait.
maxattempts1Maximum number of failover attempts before giving up.

ProxyPass /special-area http://special.example.com/ smax=5 max=10
ProxyPass / balancer://mycluster stickysession=jsessionid nofailover=On
<Proxy balancer://mycluster>
BalancerMember http://1.2.3.4:8009
BalancerMember http://1.2.3.5:8009 smax=10
# Less powerful server, don't send as many requests there
BalancerMember http://1.2.3.6:8009 smax=1 loadfactor=20
</Proxy>

When used inside a <Location> section, the first argument is omitted and the local directory is obtained from the <Location>.

If you require a more flexible reverse-proxy configuration, see the RewriteRule directive with the [P] flag.

top

ProxyPassReverse ָ��

˵�������ɷ��������������͵�HTTPӦ��ͷ�е�URL
�﷨ProxyPassReverse [path] url
������server config, virtual host, directory
״̬��չ(E)
ģ��mod_proxy

��ָ��ʹApache����HTTP�ض���Ӧ����Location, Content-Location, URIͷ���URL���������Ա�����Apache��Ϊ�������ʹ��ʱ����˷�������HTTP�ض�����ɵ��ƹ������������⡣

ֻ����ȷָ����Ӧ��ͷ�ᱻ��д������Ӧ��ͷ���ֲ��䣬����HTMLҳ���е�URLҲ���ᱻ�޸ġ��������������ݰ�������URL���ã���ô�����ƹ�������һ��������ģ����Լ�鲢��дHTML�е�URL���ã���ģ�����Nick Kew��д��mod_proxy_html��

path�DZ�������·�������ơ�url��Զ�˷������IJ���URL����ProxyPassָ���е�ʹ�÷�����ͬ��

���磬�ٶ����ط�����ӵ�е�ַhttp://example.com/ ����ô

ProxyPass /mirror/foo/ http://backend.example.com/
ProxyPassReverse /mirror/foo/ http://backend.example.com/
ProxyPassReverseCookieDomain backend.example.com public.example.com
ProxyPassReverseCookiePath / /mirror/foo/

����������ж�http://example.com/mirror/foo/bar������ֱ��ת��Ϊ��http://backend.example.com/bar�Ĵ�������(��ProxyPass�ṩ�Ĺ���)���������ض��������backend.example.com�ķ��ͣ���http://backend.example.com/bar�����ض���http://backend.example.com/quuxʱ��Apache����ת��HTTP�ض���Ӧ�𵽿ͻ���֮ǰ������Ϊhttp://example.com/mirror/foo/quux ��ע�⣺�����ڹ���URL����������UseCanonicalNameָ��������йء�

ע�⣬��ProxyPassReverseָ�������mod_rewrite�Ĵ���͸����(RewriteRule ... [P])���á���Ϊ������������Ӧ��ProxyPassָ�

����<Location>���ö���ʹ��ʱ����һ�������ᱻ���Զ�������<Location>ָ��ָ���ı���Ŀ¼��

top

ProxyPassReverseCookieDomain ָ��

˵��Adjusts the Domain string in Set-Cookie headers from a reverse- proxied server
�﷨ProxyPassReverseCookieDomain internal-domain public-domain
������server config, virtual host, directory
״̬��չ(E)
ģ��mod_proxy

Usage is basically similar to ProxyPassReverse, but instead of rewriting headers that are a URL, this rewrites the domain string in Set-Cookie headers.

top

ProxyPassReverseCookiePath ָ��

˵��Adjusts the Path string in Set-Cookie headers from a reverse- proxied server
�﷨ProxyPassReverseCookiePath internal-path public-path
������server config, virtual host, directory
״̬��չ(E)
ģ��mod_proxy

Usage is basically similar to ProxyPassReverse, but instead of rewriting headers that are a URL, this rewrites the path string in Set-Cookie headers.

top

ProxyPreserveHost ָ��

˵��ʹ�ý����HTTP����ͷ�����ʹ�������
�﷨ProxyPreserveHost On|Off
Ĭ��ֵProxyPreserveHost Off
������server config, virtual host
״̬��չ(E)
ģ��mod_proxy
���������� Apache 2.0.31 ���Ժ�İ汾�п���

������ʱ����ѡ��Ѵ��������"Host:"�д��ݸ�������������������Ǵ�����ProxyPass��ָ������������

��ѡ��һ��ΪOff״̬��It is mostly useful in special configurations like proxied mass name-based virtual hosting, where the original Host header needs to be evaluated by the backend server.

top

ProxyReceiveBufferSize ָ��

˵������HTTP��FTP���ӵĽ��ջ�������С(�ֽ�)
�﷨ProxyReceiveBufferSize bytes
Ĭ��ֵProxyReceiveBufferSize 0
������server config, virtual host
״̬��չ(E)
ģ��mod_proxy

ProxyReceiveBufferSizeָ��Ϊ���ӵ�������ָ���˴���HTTP��FTP���ӵ�(TCP/IP)������ջ����������ֵ�������512 ��������Ϊ"0"��ʾʹ��ϵͳĬ�ϵĻ����С��

ʾ��

ProxyReceiveBufferSize 2048

top

ProxyRemote ָ��

˵�����ڴ���ijЩ�ض������Զ�˴���
�﷨ProxyRemote match remote-server
������server config, virtual host
״̬��չ(E)
ģ��mod_proxy

��ָ����˴˴����Զ�˴���match������Զ�˷�����֧�ֵ�URL��ʽ�����ơ�����Զ�˷�����ʹ�õIJ���URL�����Ǵ�����������Խ������������"*"��remote-server��Զ�˷������IJ���URL���﷨Ϊ��

remote-server = scheme://hostname[:port]

scheme����Զ�˷�����������Ϣʱʹ�õ�Э�飻��ģ����ʱֻ֧��httpЭ�顣

ʾ��

ProxyRemote http://goodguys.com/ http://mirrorguys.com:8000
ProxyRemote * http://cleversite.com
ProxyRemote ftp http://ftpproxy.mydomain.com:8080

�����һ�������У�����Ὣ��װ������һ��HTTP���������е�FTP����ת��������һ���ܴ������ǵĴ���ȥ��

��ѡ��Ҳ֧�ַ���������ã�һ�����web���������Ա�Ƕ�뵽һ������������URL�ռ��У�������������һ������ת�������ġ�

top

ProxyRemoteMatch ָ��

˵������ƥ��������ʽ�������Զ�˴���
�﷨ProxyRemoteMatch regex remote-server
������server config, virtual host
״̬��չ(E)
ģ��mod_proxy

ProxyRemoteMatch��ProxyRemote�������ͬ�����˵�һ����������һ�������URL�����ƥ���������ʽ��

top

ProxyRequests ָ��

˵����������(��׼)��������
�﷨ProxyRequests On|Off
Ĭ��ֵProxyRequests Off
������server config, virtual host
״̬��չ(E)
ģ��mod_proxy

��ָ�������ֹApache��Ϊ�������������Ĺ���(����ΪOff���������ProxyPassָ��)��

��һ�����͵ķ�����������У��˿�ѡ��һ������ΪOff��

Ϊ���ܹ�����HTTP��FTPվ�㣬mod_proxy_http��mod_proxy_ftp����ͬʱ�����ڷ������С�

����

����û�жԷ�������ȡ��ȫ��ʩ֮ǰ���벻Ҫ��ProxyRequests�������Ĵ���һ�����ŵĴ��������������������������в����������������˵Ҳͬ����ˡ�

top

ProxyTimeout ָ��

˵��������������糬ʱ
�﷨ProxyTimeout seconds
Ĭ��ֵProxyTimeout 300
������server config, virtual host
״̬��չ(E)
ģ��mod_proxy
���������� Apache 2.0.31 ���Ժ�İ汾�п���

��ָ�������û��Դ�������ָ��һ����ʱֵ��������һ������/�������Ӧ�÷������������𣬶�����Ը����һ����ʱ��ʧ����ϢҲ��Ը������ȴ���֪����õ�ʱ����������Ǻ����õġ�

top

ProxyVia ָ��

˵�����ƴ����ViaӦ��ͷ��ʹ��
�﷨ProxyVia On|Off|Full|Block
Ĭ��ֵProxyVia Off
������server config, virtual host
״̬��չ(E)
ģ��mod_proxy

��ָ����ƴ����"Via:"ͷ��ʹ�á�����Ŀ���ǿ���λ�ڴ�����������еĴ�����������򡣲���RFC 2616(HTTP/1.1)14.45С���Ի�ù���"Via:"ͷ�Ľ��͡�