Squid configuration directive url_rewrite_program

Available in: 4   3.5   3.4   3.3   3.2   2.7   3.1   3.0   2.6  


Changes to url_rewrite_program in Squid-3.5:

New response kv-pair clt_conn_tag= to associates a given tag with the client TCP connection.

Changes to url_rewrite_program in Squid-3.4:

New helper response format utilizing result codes OK, ERR, and BH to signal helper lookup results. Also, key-value response values to return multiple values to Squid.

Details at http://wiki.squid-cache.org/Features/AddonHelpers.

For older versions than 3.3 see the linked pages above

Configuration Details:

Option Name:url_rewrite_program
Default Value:none
Suggested Config:

	Specify the location of the executable URL rewriter to use.
	Since they can perform almost any function there isn't one included.

	For each requested URL, the rewriter will receive on line with the format

	  [channel-ID <SP>] URL [<SP> extras]<NL>

	See url_rewrite_extras on how to send "extras" with optional values to
	the helper.
	After processing the request the helper must reply using the following format:

	  [channel-ID <SP>] result [<SP> kv-pairs]

	The result code can be:

	  OK status=30N url="..."
		Redirect the URL to the one supplied in 'url='.
		'status=' is optional and contains the status code to send
		the client in Squids HTTP response. It must be one of the
		HTTP redirect status codes: 301, 302, 303, 307, 308.
		When no status is given Squid will use 302.

	  OK rewrite-url="..."
		Rewrite the URL to the one supplied in 'rewrite-url='.
		The new URL is fetched directly by Squid and returned to
		the client as the response to its request.

		When neither of url= and rewrite-url= are sent Squid does
		not change the URL.

		Do not change the URL.

		An internal error occurred in the helper, preventing
		a result being identified. The 'message=' key name is
		reserved for delivering a log message.

	In addition to the above kv-pairs Squid also understands the following
	optional kv-pairs received from URL rewriters:
		Associates a TAG with the client TCP connection.
		The TAG is treated as a regular annotation but persists across
		future requests on the client connection rather than just the
		current request. A helper may update the TAG during subsequent
		requests be returning a new kv-pair.

	When using the concurrency= option the protocol is changed by
	introducing a query channel tag in front of the request/response.
	The query channel tag is a number between 0 and concurrency-1.
	This value must be echoed back unchanged to Squid as the first part
	of the response relating to its request.

	WARNING: URL re-writing ability should be avoided whenever possible.
		 Use the URL redirect form of response instead.

	Re-write creates a difference in the state held by the client
	and server. Possibly causing confusion when the server response
	contains snippets of its view state. Embeded URLs, response
	and content Location headers, etc. are not re-written by this

	By default, a URL rewriter is not used.









Web Site Translations