Httpd ProxyPass: Difference between revisions
(→max) |
|||
Line 85: | Line 85: | ||
==disablereuse== | ==disablereuse== | ||
Explicitly turns off persistent connections. By default is "Off". | Explicitly turns off persistent connections. By default is "Off". mod_proxy connection pool dynamics is explained here: [[httpd mod_proxy Concepts#disablereuse|mod_proxy Concepts - Connection Pooling]] | ||
==max== | ==max== | ||
Line 105: | Line 105: | ||
==acquire== | ==acquire== | ||
The number of milliseconds to wait for a connection to become free in the pool. There is no default. mod_proxy connection pool dynamics is explained here: [[httpd mod_proxy Concepts#acquire_timeout|mod_proxy Concepts - Connection Pooling]] | The number of milliseconds to wait for a connection to become free in the pool. There is no default. mod_proxy connection pool dynamics is explained here: [[httpd mod_proxy Concepts#acquire_timeout|mod_proxy Concepts - Connection Pooling]]. |
Revision as of 22:52, 2 January 2017
External
Internal
Overview
The ProxyPass directive maps remote servers into the local server URL-space, by creating a worker that handles the request associated with the declared remote URL. A more flexible alternative is the use of RewriteRule with the [P] flag.
For ProxyPass-related mod_proxy concepts see:
It can be used inside a <Location> or <LocationMatch> directive, see Example below. <ProxyPass> is not supported within <Directory> and <Files> containers.
Syntax
ProxyPass [path] !|url [key=value ...]
The path is the name of a local virtual path.
The url is a partial URL for the origin server. It cannot include a query string.
If path ends with a trailing "/", the url should also end with a trailing "/", and vice-versa, otherwise the resulting requests to the backend may miss some of the needed slashes and produce unwanted results.
Example
ProxyPass "/something" "http://example.com/something-else
Alternative using <Location>:
<Location "/something"> ProxyPass "http://example.com/something-else" </Location>
Order
ProxyPass and ProxyPassMatch rules are checked in the order in which they were specified in the configuration file, and the first rule match wins. For the same reason, exclusions must come before the general ProxyPass directives.
Also see:
Preventing a Sub-Directory to Be Proxied
ProxyPass "/something/do-not-proxy" "!" ProxyPass "/something" "http://example.com"
Connection Pool Configuration
Configuration example:
ProxyPass "/something" "httpd://backend.example.com" max=20 ttl=120 retry=300
For concepts, see:
All the parameters described below apply to BalancerMember configuration as well. BalancerMember has a few special parameters that are described here: BalancerMember Configuration Reference.
disablereuse
Explicitly turns off persistent connections. By default is "Off". mod_proxy connection pool dynamics is explained here: mod_proxy Concepts - Connection Pooling
max
Reduces the maximum number of connections in the pool, to the specified value, as described in mod_proxy Concepts - Connection Pooling.
connectiontimeout
The number of seconds httpd waits for the creation of the connection to complete. By adding "ms", the timeout can be also be set in milliseconds. The default value is given by timeout. mod_proxy connection pool dynamics is explained here: mod_proxy Concepts - Connection Pooling
ttl
The time to live in seconds after which an inactive connection in the pool is closed. mod_proxy connection pool dynamics is explained here: mod_proxy Concepts - Connection Pooling. There is no default, which means that by default connections won't expire. ttl can be used to avoid using a connection which is subject to closing because of the backend server's keep-alive timeout.
timeout
The number of seconds httpd waits for data to be sent by the backend before it timeouts. If not specified, the default is given by ProxyTimeout. mod_proxy connection pool dynamics is explained here: mod_proxy Concepts - Connection Pooling
acquire
The number of milliseconds to wait for a connection to become free in the pool. There is no default. mod_proxy connection pool dynamics is explained here: mod_proxy Concepts - Connection Pooling.