Squid configuration manual

Reference manual for squid's configuraiton directives

View the Project on GitHub

WELCOME TO SQUID 8.0.0-VCS

This is the documentation for the Squid configuration file.
This documentation can also be found online at:
	http://www.squid-cache.org/Doc/config/

You may wish to look at the Squid home page and wiki for the
FAQ and other documentation:
	http://www.squid-cache.org/
	https://wiki.squid-cache.org/SquidFaq
	https://wiki.squid-cache.org/ConfigExamples

This documentation shows what the defaults for various directives
happen to be.  If you don't need to change the default, you should
leave the line out of your squid.conf in most cases.

In some cases "none" refers to no default setting at all,
while in other cases it refers to the value of the option
- the comments for that keyword indicate if this is the case.

Configuration options can be included using the “include” directive.

Include takes a list of files to include. Quoting and wildcards are supported.

For example,

include /path/to/included/file/squid.acl.config

Includes can be nested up to a hard-coded depth of 16 levels. This arbitrary restriction is to prevent recursive include references from causing Squid entering an infinite loop whilst trying to load configuration files.

Values with byte units

Squid accepts size units on some size related directives. All
such directives are documented with a default value displaying
a unit.

Units accepted by Squid are:
	bytes - byte
	KB - Kilobyte (2^10, 1'024 bytes)
	MB - Megabyte (2^20, 1'048'576 bytes)
	GB - Gigabyte (2^30, 1'073'741'824 bytes)
Squid does not yet support KiB, MiB, and GiB unit names.

Values with time units

Time-related directives marked with either "time-units" or
"time-units-small" accept a time unit. The supported time units are:

	nanosecond (time-units-small only)
	microsecond (time-units-small only)
	millisecond
	second
	minute
	hour
	day
	week
	fortnight
	month - 30 days
	year - 31557790080 milliseconds (just over 365 days)
	decade

Values with spaces, quotes, and other special characters

Squid supports directive parameters with spaces, quotes, and other
special characters. Surround such parameters with "double quotes". Use
the configuration_includes_quoted_values directive to enable or
disable that support.

Squid supports reading configuration option parameters from external
files using the syntax:
	parameters("/path/filename")
For example:
	acl allowlist dstdomain parameters("/etc/squid/allowlist.txt")

Conditional configuration

If-statements can be used to make configuration directives
depend on conditions:

    if <CONDITION>
        ... regular configuration directives ...
    [else
        ... regular configuration directives ...]
    endif

The else part is optional. The keywords "if", "else", and "endif"
must be typed on their own lines, as if they were regular
configuration directives.

NOTE: An else-if condition is not supported.

These individual conditions types are supported:

    true
	Always evaluates to true.
    false
	Always evaluates to false.
    <integer> = <integer>
        Equality comparison of two integer numbers.

SMP-Related Macros

The following SMP-related preprocessor macros can be used.

${process_name} expands to the current Squid process "name"
(e.g., squid1, squid2, or cache1).

${process_number} expands to the current Squid process
identifier, which is an integer number (e.g., 1, 2, 3) unique
across all Squid processes of the current service instance.

${service_name} expands into the current Squid service instance
name identifier which is provided by -n on the command line.

Logformat Macros

Logformat macros can be used in many places outside of the logformat
directive. In theory, all of the logformat codes can be used as %macros,
where they are supported. In practice, a %macro expands as a dash (-) when
the transaction does not yet have enough information and a value is needed.

There is no definitive list of what tokens are available at the various
stages of the transaction.

And some information may already be available to Squid but not yet
committed where the macro expansion code can access it (report
such instances!). The macro will be expanded into a single dash
('-') in such cases. Not all macros have been tested.

OPTIONS FOR SMP

OPTIONS FOR AUTHENTICATION

ACCESS CONTROLS

NETWORK OPTIONS

TLS OPTIONS

SSL OPTIONS

OPTIONS RELATING TO EXTERNAL SSL_CRTD

OPTIONS WHICH AFFECT THE NEIGHBOR SELECTION ALGORITHM

MEMORY CACHE OPTIONS

DISK CACHE OPTIONS

LOGFILE OPTIONS

OPTIONS FOR TROUBLESHOOTING

OPTIONS FOR FTP GATEWAYING

OPTIONS FOR EXTERNAL SUPPORT PROGRAMS

OPTIONS FOR URL REWRITING

OPTIONS FOR STORE ID

OPTIONS FOR TUNING THE CACHE

HTTP OPTIONS

TIMEOUTS

ADMINISTRATIVE PARAMETERS

HTTPD-ACCELERATOR OPTIONS

DELAY POOL PARAMETERS

CLIENT DELAY POOL PARAMETERS

WCCPv1 AND WCCPv2 CONFIGURATION OPTIONS

PERSISTENT CONNECTION HANDLING

Also see “pconn_timeout” in the TIMEOUTS section

CACHE DIGEST OPTIONS

SNMP OPTIONS

ICP OPTIONS

MULTICAST ICP OPTIONS

INTERNAL ICON OPTIONS

ERROR PAGE OPTIONS

OPTIONS INFLUENCING REQUEST FORWARDING

ADVANCED NETWORKING OPTIONS

ICAP OPTIONS

eCAP OPTIONS

MESSAGE ADAPTATION OPTIONS

DNS OPTIONS

MISCELLANEOUS

Alphabetic index