2009-09-19 12:27:24 +08:00
|
|
|
TINYPROXY.CONF(5)
|
|
|
|
=================
|
|
|
|
:man source: Version @VERSION@
|
|
|
|
:man manual: Tinyproxy manual
|
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
|
|
|
|
|
|
|
tinyproxy.conf - Tinyproxy HTTP proxy daemon configuration file
|
|
|
|
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
|
|
|
|
|
|
|
*tinyproxy.conf*
|
|
|
|
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
|
|
|
|
2009-09-20 01:34:04 +08:00
|
|
|
`tinyproxy(8)` reads its configuration file, typically stored in
|
|
|
|
`/etc/tinyproxy/tinyproxy.conf` (or passed to Tinyproxy with -c on the
|
|
|
|
command line). This manpage describes the syntax and contents of the
|
|
|
|
configuration file.
|
|
|
|
|
|
|
|
The Tinyproxy configuration file contains key-value pairs, one per
|
|
|
|
line. Lines starting with `#` and empty lines are comments and are
|
|
|
|
ignored. Keywords are case-insensitive, whereas values are
|
|
|
|
case-sensitive. Values may be enclosed in double-quotes (") if they
|
|
|
|
contain spaces.
|
|
|
|
|
|
|
|
The possible keywords and their descriptions are as follows:
|
|
|
|
|
|
|
|
*User*::
|
|
|
|
|
|
|
|
The user which the Tinyproxy process should run as, after the
|
2009-09-20 14:25:47 +08:00
|
|
|
initial port-binding has been done as the `root` user. Either the
|
|
|
|
user name or the UID may be specified.
|
2009-09-20 01:34:04 +08:00
|
|
|
|
|
|
|
*Group*::
|
|
|
|
|
|
|
|
The group which the Tinyproxy process should run as, after the
|
2009-09-20 14:25:47 +08:00
|
|
|
initial port-binding has been done as the `root` user. Either the
|
2009-09-20 14:23:44 +08:00
|
|
|
group name or the GID may be specified.
|
2009-09-20 01:34:04 +08:00
|
|
|
|
|
|
|
*Port*::
|
|
|
|
|
|
|
|
The port which the Tinyproxy service will listen on. If the port is
|
|
|
|
less than 1024, you will need to start the Tinyproxy process as the
|
2009-09-20 14:25:47 +08:00
|
|
|
`root` user.
|
2009-09-19 12:27:24 +08:00
|
|
|
|
2009-09-20 07:53:04 +08:00
|
|
|
*Listen*::
|
|
|
|
|
|
|
|
By default, Tinyproxy listens for connections on all available
|
|
|
|
interfaces (i.e. it listens on the wildcard address `0.0.0.0`).
|
|
|
|
With this configuration parameter, Tinyproxy can be told to listen
|
|
|
|
only on one specific address.
|
|
|
|
|
|
|
|
*Bind*::
|
|
|
|
|
|
|
|
This allows you to specify which address Tinyproxy will bind
|
|
|
|
to for outgoing connections to web servers or upstream proxies.
|
|
|
|
|
|
|
|
*BindSame*::
|
|
|
|
|
|
|
|
If this boolean parameter is set to `yes`, then Tinyproxy will
|
|
|
|
bind the outgoing connection to the IP address of the incoming
|
|
|
|
connection that triggered the outgoing request.
|
|
|
|
|
|
|
|
*Timeout*::
|
|
|
|
|
|
|
|
The maximum number of seconds of inactivity a connection is
|
|
|
|
allowed to have before it is closed by Tinyproxy.
|
2009-09-19 12:27:24 +08:00
|
|
|
|
2009-09-22 05:47:45 +08:00
|
|
|
*ErrorFile*::
|
|
|
|
|
|
|
|
This parameter controls which HTML file Tinyproxy returns when a
|
|
|
|
given HTTP error occurs. It takes two arguments, the error number
|
|
|
|
and the location of the HTML error file.
|
|
|
|
|
|
|
|
*DefaultErrorFile*::
|
|
|
|
|
|
|
|
This parameter controls the HTML template file returned when an
|
|
|
|
error occurs for which no specific error file has been set.
|
|
|
|
|
2009-11-10 20:36:41 +08:00
|
|
|
*StatHost*::
|
|
|
|
|
|
|
|
This configures the host name or IP address that is treated
|
|
|
|
as the `stat host`: Whenever a request for this host is received,
|
|
|
|
Tinyproxy will return an internal statistics page instead of
|
|
|
|
forwarding the request to that host. The template for this
|
|
|
|
page can be configured with the `StatFile` configuration option.
|
|
|
|
The default value of `StatHost` is `@TINYPROXY_STATHOST@`.
|
2009-09-22 05:47:45 +08:00
|
|
|
|
|
|
|
*StatFile*::
|
|
|
|
|
|
|
|
This configures the HTML file that Tinyproxy sends when
|
|
|
|
a request for the stathost is received. If this parameter is
|
2009-09-28 21:21:42 +08:00
|
|
|
not set, Tinyproxy returns a hard-coded basic statistics page.
|
2009-09-22 05:47:45 +08:00
|
|
|
See the STATHOST section in the `tinyproxy(8)` manual page
|
|
|
|
for details.
|
2010-01-03 22:44:43 +08:00
|
|
|
+
|
2009-09-22 05:47:45 +08:00
|
|
|
Note that the StatFile and the error files configured with ErrorFile
|
|
|
|
and DefaultErrorFile are template files that can contain a few
|
|
|
|
template variables that Tinyproxy expands prior to delivery.
|
|
|
|
Examples are "\{cause}" for an abbreviated error description and
|
2009-09-28 21:21:42 +08:00
|
|
|
"\{detail}" for a detailed error message. The `tinyproxy(8)`
|
2009-09-22 05:47:45 +08:00
|
|
|
manual page contains a description of all template variables.
|
|
|
|
|
2009-09-22 06:19:12 +08:00
|
|
|
*LogFile*::
|
|
|
|
|
|
|
|
This controls the location of the file to which Tinyproxy
|
|
|
|
writes its debug output. Alternatively, Tinyproxy can log
|
|
|
|
to syslog -- see the Syslog option.
|
|
|
|
|
|
|
|
*Syslog*::
|
|
|
|
|
2009-09-27 18:41:30 +08:00
|
|
|
When set to `On`, this option tells Tinyproxy to write its
|
2009-09-22 06:19:12 +08:00
|
|
|
debug messages to syslog instead of to a log file configured
|
|
|
|
with `LogFile`. These two options are mutually exclusive.
|
|
|
|
|
|
|
|
*LogLevel*::
|
|
|
|
|
2010-01-03 23:16:37 +08:00
|
|
|
Sets the log level. Messages from the set level and above are
|
|
|
|
logged. For example, if the LogLevel was set to Warning, then all
|
|
|
|
log messages from Warning to Critical would be output, but Notice
|
|
|
|
and below would be suppressed. Allowed values are:
|
2009-09-22 06:19:12 +08:00
|
|
|
|
|
|
|
* Critical (least verbose)
|
|
|
|
* Error
|
|
|
|
* Warning
|
|
|
|
* Notice
|
|
|
|
* Connect (log connections without Info's noise)
|
|
|
|
* Info (most verbose)
|
|
|
|
|
2009-09-22 06:22:19 +08:00
|
|
|
*PidFile*::
|
|
|
|
|
|
|
|
This option controls the location of the file where the main
|
2009-09-28 21:21:42 +08:00
|
|
|
Tinyproxy process stores its process ID for signaling purposes.
|
2009-09-22 06:22:19 +08:00
|
|
|
|
2009-09-27 18:40:44 +08:00
|
|
|
*XTinyproxy*::
|
|
|
|
|
|
|
|
Setting this option to `Yes` tells Tinyproxy to add a header
|
|
|
|
`X-Tinyproxy` containing the client's IP address to the request.
|
|
|
|
|
2010-01-03 23:20:07 +08:00
|
|
|
*Upstream*::
|
2009-09-28 14:36:59 +08:00
|
|
|
|
|
|
|
This option allows you to set up a set of rules for deciding
|
2010-05-30 12:31:36 +08:00
|
|
|
whether an upstream proxy server is to be used, based on the
|
2009-09-28 14:36:59 +08:00
|
|
|
host or domain of the site being accessed. The rules are stored
|
|
|
|
in the order encountered in the configuration file and the
|
2018-02-26 02:18:53 +08:00
|
|
|
LAST matching rule wins. The following forms for specifying upstream
|
|
|
|
rules exist:
|
2009-09-28 14:36:59 +08:00
|
|
|
|
2018-02-26 02:18:53 +08:00
|
|
|
* 'upstream type host:port' turns proxy upstream support on generally.
|
2009-09-28 14:36:59 +08:00
|
|
|
|
2018-02-26 02:18:53 +08:00
|
|
|
* 'upstream type user:pass@host:port' does the same, but uses the
|
|
|
|
supplied credentials for authentication.
|
2009-09-28 14:36:59 +08:00
|
|
|
|
2018-02-26 02:18:53 +08:00
|
|
|
* 'upstream type host:port "site_spec"' turns on the upstream proxy
|
|
|
|
for the sites matching `site_spec`.
|
|
|
|
|
|
|
|
`type` can be one of `http`, `socks4`, `socks5`, `none`.
|
|
|
|
|
|
|
|
* 'upstream none "site_spec"' turns off upstream support for sites
|
2009-09-28 14:36:59 +08:00
|
|
|
matching `site_spec`.
|
|
|
|
|
|
|
|
The site can be specified in various forms as a hostname, domain
|
|
|
|
name or as an IP range:
|
|
|
|
|
|
|
|
* 'name' matches host exactly
|
|
|
|
* '.name' matches any host in domain "name"
|
|
|
|
* '.' matches any host with no domain (in 'empty' domain)
|
|
|
|
* 'IP/bits' matches network/mask
|
|
|
|
* 'IP/mask' matches network/mask
|
|
|
|
|
2009-09-28 14:40:35 +08:00
|
|
|
*MaxClients*::
|
|
|
|
|
simplify codebase by using one thread/conn, instead of preforked procs
the existing codebase used an elaborate and complex approach for
its parallelism:
5 different config file options, namely
- MaxClients
- MinSpareServers
- MaxSpareServers
- StartServers
- MaxRequestsPerChild
were used to steer how (and how many) parallel processes tinyproxy
would spin up at start, how many processes at each point needed to
be idle, etc.
it seems all preforked processes would listen on the server port
and compete with each other about who would get assigned the new
incoming connections.
since some data needs to be shared across those processes, a half-
baked "shared memory" implementation was provided for this purpose.
that implementation used to use files in the filesystem, and since
it had a big FIXME comment, the author was well aware of how hackish
that approach was.
this entire complexity is now removed. the main thread enters
a loop which polls on the listening fds, then spins up a new
thread per connection, until the maximum number of connections
(MaxClients) is hit. this is the only of the 5 config options
left after this cleanup. since threads share the same address space,
the code necessary for shared memory access has been removed.
this means that the other 4 mentioned config option will now
produce a parse error, when encountered.
currently each thread uses a hardcoded default of 256KB per thread
for the thread stack size, which is quite lavish and should be
sufficient for even the worst C libraries, but people may want
to tweak this value to the bare minimum, thus we may provide a new
config option for this purpose in the future.
i suspect that on heavily optimized C libraries such a musl, a
stack size of 8-16 KB per thread could be sufficient.
since the existing list implementation in vector.c did not provide
a way to remove a single item from an existing list, i added my
own list implementation from my libulz library which offers this
functionality, rather than trying to add an ad-hoc, and perhaps
buggy implementation to the vector_t list code. the sblist
code is contained in an 80 line C file and as simple as it can get,
while offering good performance and is proven bugfree due to years
of use in other projects.
2018-12-17 08:23:09 +08:00
|
|
|
Tinyproxy creates one thread for each connected client.
|
2009-09-28 14:40:35 +08:00
|
|
|
This options specifies the absolute highest number processes that
|
|
|
|
will be created. With other words, only MaxClients clients can be
|
|
|
|
connected to Tinyproxy simultaneously.
|
2009-09-28 14:36:59 +08:00
|
|
|
|
2009-09-28 15:50:31 +08:00
|
|
|
*Allow*::
|
|
|
|
*Deny*::
|
|
|
|
|
|
|
|
The `Allow` and `Deny` options provide a means to customize
|
|
|
|
which clients are allowed to access Tinyproxy. `Allow` and `Deny`
|
|
|
|
lines can be specified multiple times to build the access control
|
|
|
|
list for Tinyproxy. The order in the config file is important.
|
2010-01-25 22:05:30 +08:00
|
|
|
If there are no `Allow` or `Deny` lines, then all clients are
|
2009-09-28 15:50:31 +08:00
|
|
|
allowed. Otherwise, the default action is to deny access.
|
2010-01-25 22:05:30 +08:00
|
|
|
The argument to `Allow` or `Deny` can be a single IP address
|
2009-09-28 15:50:31 +08:00
|
|
|
of a client host, like `127.0.0.1`, an IP address range, like
|
|
|
|
`192.168.0.1/24` or a string that will be matched against the
|
|
|
|
end of the client host name, i.e, this can be a full host name
|
|
|
|
like `host.example.com` or a domain name like `.example.com` or
|
|
|
|
even a top level domain name like `.com`.
|
2018-12-31 23:47:40 +08:00
|
|
|
Note that by adding a rule using a host or domain name, a costly name
|
|
|
|
lookup has to be done for every new connection, which could slow down
|
|
|
|
the service considerably.
|
2009-09-28 15:50:31 +08:00
|
|
|
|
2010-01-09 00:35:17 +08:00
|
|
|
*AddHeader*::
|
|
|
|
|
|
|
|
Configure one or more HTTP request headers to be added to outgoing
|
|
|
|
HTTP requests that Tinyproxy makes. Note that this option will not
|
|
|
|
work for HTTPS traffic, as Tinyproxy has no control over what
|
|
|
|
headers are exchanged.
|
|
|
|
+
|
|
|
|
----
|
|
|
|
AddHeader "X-My-Header" "Powered by Tinyproxy"
|
|
|
|
----
|
|
|
|
|
2009-09-28 15:59:53 +08:00
|
|
|
*ViaProxyName*::
|
|
|
|
|
|
|
|
RFC 2616 requires proxies to add a `Via` header to the HTTP
|
|
|
|
requests, but using the real host name can be a security
|
2009-10-11 04:24:02 +08:00
|
|
|
concern. If the `ViaProxyname` option is present, then its
|
2009-09-28 15:59:53 +08:00
|
|
|
string value will be used as the host name in the Via header.
|
|
|
|
Otherwise, the server's host name will be used.
|
|
|
|
|
2009-10-11 07:48:41 +08:00
|
|
|
*DisableViaHeader*::
|
|
|
|
|
|
|
|
When this is set to yes, Tinyproxy does NOT add the `Via` header
|
|
|
|
to the requests. This virtually puts Tinyproxy into stealth mode.
|
|
|
|
Note that RFC 2616 requires proxies to set the `Via` header, so by
|
|
|
|
enabling this option, you break compliance.
|
|
|
|
Don't disable the `Via` header unless you know what you are doing...
|
|
|
|
|
2009-09-28 17:07:37 +08:00
|
|
|
*Filter*::
|
|
|
|
|
|
|
|
Tinyproxy supports filtering of web sites based on URLs or
|
|
|
|
domains. This option specifies the location of the file
|
|
|
|
containing the filter rules, one rule per line.
|
|
|
|
|
|
|
|
*FilterURLs*::
|
|
|
|
|
|
|
|
If this boolean option is set to `Yes` or `On`, filtering is
|
|
|
|
performed for URLs rather than for domains. The default is to
|
|
|
|
filter based on domains.
|
|
|
|
|
|
|
|
*FilterExtended*::
|
|
|
|
|
|
|
|
If this boolean option is set to `Yes`, then extended POSIX
|
|
|
|
regular expressions are used for matching the filter rules.
|
|
|
|
The default is to use basic POSIX regular expressions.
|
|
|
|
|
|
|
|
*FilterCaseSensitive*::
|
|
|
|
|
|
|
|
If this boolean option is set to `Yes`, then the filter rules
|
|
|
|
are matched in a case sensitive manner. The default is to
|
|
|
|
match case-insensitively.
|
|
|
|
|
|
|
|
*FilterDefaultDeny*::
|
|
|
|
|
|
|
|
The default filtering policy is to allow everything that is
|
|
|
|
not matched by a filtering rule. Setting `FilterDefaultDeny`
|
|
|
|
to `Yes` changes the policy do deny everything but the domains
|
|
|
|
or URLs matched by the filtering rules.
|
|
|
|
|
2009-09-28 17:34:41 +08:00
|
|
|
*Anonymous*::
|
|
|
|
|
|
|
|
If an `Anonymous` keyword is present, then anonymous proxying
|
|
|
|
is enabled. The headers listed with `Anonymous` are allowed
|
|
|
|
through, while all others are denied. If no Anonymous keyword
|
|
|
|
is present, then all headers are allowed through. You must
|
|
|
|
include quotes around the headers.
|
2010-01-03 22:44:43 +08:00
|
|
|
+
|
2009-09-28 17:34:41 +08:00
|
|
|
Most sites require cookies to be enabled for them to work correctly, so
|
2010-01-03 22:44:29 +08:00
|
|
|
you will need to allow cookies through if you access those sites.
|
2010-01-03 22:44:43 +08:00
|
|
|
+
|
2009-09-28 17:34:41 +08:00
|
|
|
Example:
|
2010-01-03 22:44:43 +08:00
|
|
|
+
|
|
|
|
----
|
|
|
|
Anonymous "Host"
|
|
|
|
Anonymous "Authorization"
|
|
|
|
Anonymous "Cookie"
|
|
|
|
----
|
2009-09-28 17:34:41 +08:00
|
|
|
|
2009-09-28 17:37:30 +08:00
|
|
|
*ConnectPort*::
|
|
|
|
|
|
|
|
This option can be used to specify the ports allowed for the
|
|
|
|
CONNECT method. If no `ConnectPort` line is found, then all
|
|
|
|
ports are allowed. To disable CONNECT altogether, include a
|
|
|
|
single ConnectPort line with a value of `0`.
|
2009-09-28 17:34:41 +08:00
|
|
|
|
2009-09-28 18:18:52 +08:00
|
|
|
*ReversePath*::
|
|
|
|
|
|
|
|
Configure one or more ReversePath directives to enable reverse proxy
|
|
|
|
support. With reverse proxying it's possible to make a number of
|
|
|
|
sites appear as if they were part of a single site.
|
2010-01-03 22:44:43 +08:00
|
|
|
+
|
2009-09-28 18:56:19 +08:00
|
|
|
If you uncomment the following two directives and run Tinyproxy
|
2009-09-28 18:18:52 +08:00
|
|
|
on your own computer at port 8888, you can access example.com,
|
|
|
|
using http://localhost:8888/example/.
|
2010-01-03 22:44:43 +08:00
|
|
|
+
|
|
|
|
----
|
|
|
|
ReversePath "/example/" "http://www.example.com/"
|
|
|
|
----
|
2009-09-28 18:18:52 +08:00
|
|
|
|
|
|
|
*ReverseOnly*::
|
|
|
|
|
2009-09-28 18:56:19 +08:00
|
|
|
When using Tinyproxy as a reverse proxy, it is STRONGLY
|
2009-09-28 18:18:52 +08:00
|
|
|
recommended that the normal proxy is turned off by setting
|
|
|
|
this boolean option to `Yes`.
|
|
|
|
|
|
|
|
*ReverseMagic*::
|
|
|
|
|
|
|
|
Setting this option to `Yes`, makes Tinyproxy use a cookie to
|
|
|
|
track reverse proxy mappings. If you need to reverse proxy
|
|
|
|
sites which have absolute links you must use this option.
|
|
|
|
|
|
|
|
*ReverseBaseURL*::
|
|
|
|
|
|
|
|
The URL that is used to access this reverse proxy. The URL is
|
|
|
|
used to rewrite HTTP redirects so that they won't escape the
|
|
|
|
proxy. If you have a chain of reverse proxies, you'll need to
|
|
|
|
put the outermost URL here (the address which the end user
|
|
|
|
types into his/her browser). If this option is not set then
|
|
|
|
no rewriting of redirects occurs.
|
|
|
|
|
2009-09-28 14:36:59 +08:00
|
|
|
|
2009-09-19 12:27:24 +08:00
|
|
|
BUGS
|
|
|
|
----
|
|
|
|
|
|
|
|
To report bugs in Tinyproxy, please visit
|
2016-01-04 05:16:21 +08:00
|
|
|
<https://tinyproxy.github.io/[https://tinyproxy.github.io/]>.
|
2009-09-19 12:27:24 +08:00
|
|
|
|
|
|
|
|
2010-01-16 19:10:48 +08:00
|
|
|
SEE ALSO
|
|
|
|
--------
|
|
|
|
tinyproxy(8)
|
|
|
|
|
|
|
|
|
2010-01-16 19:12:02 +08:00
|
|
|
AUTHOR
|
|
|
|
------
|
|
|
|
|
2010-04-22 23:44:27 +08:00
|
|
|
This manpage was written by the Tinyproxy project team.
|
2010-01-16 19:12:02 +08:00
|
|
|
|
|
|
|
|
2009-09-19 12:27:24 +08:00
|
|
|
COPYRIGHT
|
|
|
|
---------
|
|
|
|
|
2018-09-01 10:02:36 +08:00
|
|
|
Copyright (c) 1998-2018 the Tinyproxy authors.
|
2009-09-19 12:27:24 +08:00
|
|
|
|
|
|
|
This program is distributed under the terms of the GNU General Public
|
|
|
|
License version 2 or above. See the COPYING file for additional
|
|
|
|
information.
|