4 >The Main Configuration File</TITLE
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.64
10 TITLE="Privoxy User Manual"
11 HREF="index.html"><LINK
13 TITLE="Privoxy Configuration"
14 HREF="configuration.html"><LINK
17 HREF="actions-file.html"><LINK
20 HREF="../p_doc.css"></HEAD
39 >Privoxy User Manual</TH
47 HREF="configuration.html"
60 HREF="actions-file.html"
74 >7. The Main Configuration File</A
77 > Again, the main configuration file is named <TT
81 Linux/Unix/BSD and OS/2, and <TT
85 Configuration lines consist of an initial keyword followed by a list of
86 values, all separated by whitespace (any number of spaces or tabs). For
95 >confdir /etc/privoxy</I
101 > Assigns the value <TT
108 > and thus indicates that the configuration
109 directory is named <SPAN
111 >"/etc/privoxy/"</SPAN
114 > All options in the config file except for <TT
121 > are optional. Watch out in the below description
122 for what happens if you leave them unset.</P
124 > The main config file controls all aspects of <SPAN
128 operation that are not location dependent (i.e. they apply universally, no matter
129 where you may be surfing).</P
136 >7.1. Configuration and Log File Locations</A
142 > can (and normally does) use a number of
143 other files for additional configuration, help and logging.
144 This section of the configuration file tells <SPAN
148 where to find those other files. </P
150 > The user running Privoxy, must have read permission for all
151 configuration files, and write permission to any files that would
152 be modified, such as log files.</P
170 >The directory where the other configuration files are located</P
182 >/etc/privoxy (Unix) <I
188 > installation dir (Windows) </P
191 >Effect if unset:</DT
212 > When development goes modular and multi-user, the blocker, filter, and
213 per-user config will be stored in subdirectories of <SPAN
217 For now, the configuration directory structure is flat, except for
220 >confdir/templates</TT
221 >, where the HTML templates for CGI
222 output reside (e.g. <SPAN
248 > The directory where all logging takes place (i.e. where <TT
268 >/var/log/privoxy (Unix) <I
274 > installation dir (Windows) </P
277 >Effect if unset:</DT
307 >7.1.3. actionsfile</A
310 NAME="DEFAULT.ACTION"
313 NAME="STANDARD.ACTION"
328 HREF="actions-file.html"
337 >File name, relative to <TT
356 CLASS="LITERALLAYOUT"
357 > standard # Internal purposes, no editing recommended</P
364 CLASS="LITERALLAYOUT"
365 > default # Main actions file</P
372 CLASS="LITERALLAYOUT"
373 > user # User customizations</P
383 >Effect if unset:</DT
386 > No actions are taken at all. Simple neutral proxying.
396 > lines are permitted, and are in fact recommended!
400 The default values include standard.action, which is used for internal
401 purposes and should be loaded, default.action, which is the
405 > actions file maintained by the developers, and
409 >, where you can make your personal additions.
413 Actions files are where all the per site and per URL configuration is done for
414 ad blocking, cookie management, privacy considerations, etc.
415 There is no point in using <SPAN
419 least one actions file.
431 >7.1.4. filterfile</A
434 NAME="DEFAULT.FILTER"
446 HREF="actions-file.html#FILTER"
455 >File name, relative to <TT
464 >default.filter (Unix) <I
467 > default.filter.txt (Windows)</P
470 >Effect if unset:</DT
473 > No textual content filtering takes place, i.e. all
483 actions in the actions files are turned neutral.
492 >"default.filter"</SPAN
493 > file contains content modification rules
496 >"regular expressions"</SPAN
497 >. These rules permit powerful
498 changes on the content of Web pages, e.g., you could disable your favorite
499 JavaScript annoyances, re-write the actual displayed text, or just have some
507 it appears on a Web page.
530 > The log file to use
537 >File name, relative to <TT
549 > privoxy.log (Windows)</P
552 >Effect if unset:</DT
555 > No log file is used, all log messages go to the console (<TT
565 > The windows version will additionally log to the console.
568 > The logfile is where all logging and error messages are written. The level
569 of detail and number of messages are set with the <TT
573 option (see below). The logfile can be useful for tracking down a problem with
577 > (e.g., it's not blocking an ad you
578 think it should block) but in most cases you probably will never look at it.
581 > Your logfile will grow indefinitely, and you will probably want to
582 periodically remove it. On Unix systems, you can do this with a cron job
586 >). For Red Hat, a <B
590 script has been included.
593 > On SuSE Linux systems, you can place a line like <SPAN
596 +1024k 644 nobody.nogroup"</SPAN
601 the effect that cron.daily will automatically archive, gzip, and empty the
602 log, when it exceeds 1M size.
605 > Any log files must be writable by whatever user <SPAN
609 is being run as (default on UNIX, user id is <SPAN
635 > The file to store intercepted cookies in
642 >File name, relative to <TT
654 > privoxy.jar (Windows)</P
657 >Effect if unset:</DT
660 > Intercepted cookies are not stored at all.
667 > The jarfile may grow to ridiculous sizes over time.
690 > The trust file to use
697 >File name, relative to <TT
708 >Unset (commented out)</I
709 >. When activated: trust (Unix) <I
712 > trust.txt (Windows)</P
715 >Effect if unset:</DT
718 > The whole trust mechanism is turned off.
725 > The trust mechanism is an experimental feature for building white-lists and should
726 be used with care. It is <I
729 > recommended for the casual user.
732 > If you specify a trust file, <SPAN
736 access to sites that are named in the trustfile.
737 You can also mark sites as trusted referrers (with <TT
741 the effect that access to untrusted sites will be granted, if a link from a
742 trusted referrer was used.
743 The link target will then be added to the <SPAN
747 Possible applications include limiting Internet access for children.
753 > operator in the trust file, it may grow considerably over time.
766 >7.2. Local Set-up Documentation</A
769 > If you intend to operate <SPAN
773 that just yourself, it might be a good idea to let them know how to reach
774 you, what you block and why you do that, your policies etc.
782 >7.2.1. user-manual</A
793 > Location of the <SPAN
803 >A fully qualified URI</P
815 >Effect if unset:</DT
819 HREF="http://www.privoxy.org/user-manual/"
821 >http://www.privoxy.org/<TT
828 will be used, where <TT
843 > The User Manual URI is used for help links from some of the internal CGI pages.
844 The manual itself is normally packaged with the binary distributions, so you propably want
845 to set this to a locally installed copy. For multi-user setups, you could provide a copy on
846 a local webserver for all your users and use the corresponding URL here.
852 > Unix, in local filesystem:
863 >user-manual  file:///usr/share/doc/privoxy-2.9.15/user-manual/</PRE
870 > Any platform, on local webserver (called <SPAN
872 >"local-webserver"</SPAN
884 >user-manual  http://local-webserver/privoxy-user-manual/</PRE
909 > If set, this option should be <I
911 >the first option in the config file</I
913 it is used while the config file is being read.
928 NAME="TRUST-INFO-URL"
929 >7.2.2. trust-info-url</A
940 > A URL to be displayed in the error page that users will see if access to an untrusted page is denied.
953 >Two example URL are provided</P
956 >Effect if unset:</DT
959 > No links are displayed on the "untrusted" error page.
966 > The value of this option only matters if the experimental trust mechanism has been
973 > If you use the trust mechanism, it is a good idea to write up some on-line
974 documentation about your trust policy and to specify the URL(s) here.
975 Use multiple times for multiple URLs.
978 > The URL(s) should be added to the trustfile as well, so users don't end up
979 locked out from the information on why they were locked out in the first place!
991 >7.2.3. admin-address</A
1002 > An email address to reach the proxy administrator.
1021 >Effect if unset:</DT
1024 > No email address is displayed on error pages and the CGI user interface.
1038 are unset, the whole "Local Privoxy Support" box on all generated pages will
1050 NAME="PROXY-INFO-URL"
1051 >7.2.4. proxy-info-url</A
1056 CLASS="VARIABLELIST"
1062 > A URL to documentation about the local <SPAN
1066 configuration or policies.
1085 >Effect if unset:</DT
1088 > No link to local documentation is displayed on error pages and the CGI user interface.
1102 are unset, the whole "Local Privoxy Support" box on all generated pages will
1106 > This URL shouldn't be blocked ;-)
1122 > These options are mainly useful when tracing a problem.
1123 Note that you might also want to invoke
1131 command line option when debugging.
1144 CLASS="VARIABLELIST"
1150 > Key values that determine what information gets logged.
1163 >12289 (i.e.: URLs plus informational and warning messages)</P
1166 >Effect if unset:</DT
1169 > Nothing gets logged.
1176 > The available debug levels are:
1186 CLASS="PROGRAMLISTING"
1187 > debug 1 # show each GET/POST/CONNECT request
1188 debug 2 # show each connection status
1189 debug 4 # show I/O status
1190 debug 8 # show header parsing
1191 debug 16 # log all data into the logfile
1192 debug 32 # debug force feature
1193 debug 64 # debug regular expression filter
1194 debug 128 # debug fast redirects
1195 debug 256 # debug GIF de-animation
1196 debug 512 # Common Log Format
1197 debug 1024 # debug kill pop-ups
1198 debug 4096 # Startup banner and warnings.
1199 debug 8192 # Non-fatal errors</PRE
1206 > To select multiple debug levels, you can either add them or use
1213 > A debug level of 1 is informative because it will show you each request
1216 >1, 4096 and 8192 are highly recommended</I
1218 so that you will notice when things go wrong. The other levels are probably
1219 only of interest if you are hunting down a specific problem. They can produce
1220 a hell of an output (especially 16).
1224 > The reporting of <I
1227 > errors (i.e. ones which crash
1231 >) is always on and cannot be disabled.
1234 > If you want to use CLF (Common Log Format), you should set <SPAN
1241 > and not enable anything else.
1252 NAME="SINGLE-THREADED"
1253 >7.3.2. single-threaded</A
1258 CLASS="VARIABLELIST"
1264 > Whether to run only one server thread
1286 >Effect if unset:</DT
1289 > Multi-threaded (or, where unavailable: forked) operation, i.e. the ability to
1290 serve multiple requests simultaneously.
1297 > This option is only there for debug purposes and you should never
1300 >It will drastically reduce performance.</I
1313 NAME="ACCESS-CONTROL"
1314 >7.4. Access Control and Security</A
1317 > This section of the config file controls the security-relevant aspects
1328 NAME="LISTEN-ADDRESS"
1329 >7.4.1. listen-address</A
1334 CLASS="VARIABLELIST"
1340 > The IP address and TCP port on which <SPAN
1344 listen for client requests.
1370 >Effect if unset:</DT
1373 > Bind to localhost (127.0.0.1), port 8118. This is suitable and recommended for
1374 home users who run <SPAN
1377 > on the same machine as
1385 > You will need to configure your browser(s) to this proxy address and port.
1388 > If you already have another service running on port 8118, or if you want to
1389 serve requests from other machines (e.g. on your local network) as well, you
1390 will need to override the default.
1393 > If you leave out the IP address, <SPAN
1397 bind to all interfaces (addresses) on your machine and may become reachable
1398 from the Internet. In that case, consider using access control lists (ACL's)
1402 > below), or a firewall.
1409 > Suppose you are running <SPAN
1413 a machine which has the address 192.168.0.1 on your local private network
1414 (192.168.0.0) and has another outside connection with a different address.
1415 You want it to serve requests from inside only:
1425 CLASS="PROGRAMLISTING"
1426 > listen-address 192.168.0.1:8118</PRE
1447 CLASS="VARIABLELIST"
1453 > Initial state of "toggle" status
1469 >Effect if unset:</DT
1472 > Act as if toggled on
1479 > If set to 0, <SPAN
1485 >"toggled off"</SPAN
1486 > mode, i.e. behave like a normal, content-neutral
1489 >enable-remote-toggle</TT
1491 below. This is not really useful anymore, since toggling is much easier
1493 HREF="http://config.privoxy.org/toggle"
1497 > than via editing the <TT
1503 > The windows version will only display the toggle icon in the system tray
1504 if this option is present.
1515 NAME="ENABLE-REMOTE-TOGGLE"
1516 >7.4.3. enable-remote-toggle</A
1521 CLASS="VARIABLELIST"
1527 > Whether or not the <A
1528 HREF="http://config.privoxy.org/toggle"
1548 >Effect if unset:</DT
1551 > The web-based toggle feature is disabled.
1558 > When toggled off, <SPAN
1561 > acts like a normal,
1562 content-neutral proxy, i.e. it acts as if none of the actions applied to
1566 > For the time being, access to the toggle feature can <I
1570 controlled separately by <SPAN
1573 > or HTTP authentication,
1574 so that everybody who can access <SPAN
1585 toggle it for all users. So this option is <I
1589 for multi-user environments with untrusted users.
1592 > Note that you must have compiled <SPAN
1596 support for this feature, otherwise this option has no effect.
1607 NAME="ENABLE-EDIT-ACTIONS"
1608 >7.4.4. enable-edit-actions</A
1613 CLASS="VARIABLELIST"
1619 > Whether or not the <A
1620 HREF="http://config.privoxy.org/show-status"
1640 >Effect if unset:</DT
1643 > The web-based actions file editor is disabled.
1650 > For the time being, access to the editor can <I
1654 controlled separately by <SPAN
1657 > or HTTP authentication,
1658 so that everybody who can access <SPAN
1669 modify its configuration for all users. So this option is <I
1673 > for multi-user environments with untrusted users.
1676 > Note that you must have compiled <SPAN
1680 support for this feature, otherwise this option has no effect.
1692 >7.4.5. ACLs: permit-access and deny-access</A
1703 CLASS="VARIABLELIST"
1709 > Who can access what.
1751 > are IP addresses in dotted decimal notation or valid
1763 > are subnet masks in CIDR notation, i.e. integer
1764 values from 2 to 30 representing the length (in bits) of the network address. The masks and the whole
1765 destination part are optional.
1778 >Effect if unset:</DT
1781 > Don't restrict access further than implied by <TT
1791 > Access controls are included at the request of ISPs and systems
1792 administrators, and <I
1794 >are not usually needed by individual users</I
1796 For a typical home user, it will normally suffice to ensure that
1800 > only listens on the localhost or internal (home)
1801 network address by means of the <TT
1807 > Please see the warnings in the FAQ that this proxy is not intended to be a substitute
1808 for a firewall or to encourage anyone to defer addressing basic security
1812 > Multiple ACL lines are OK.
1813 If any ACLs are specified, then the <SPAN
1817 talks only to IP addresses that match at least one <TT
1821 and don't match any subsequent <TT
1824 > line. In other words, the
1825 last match wins, with the default being <TT
1834 > is using a forwarder (see <TT
1838 for a particular destination URL, the <TT
1844 that is examined is the address of the forwarder and <I
1848 of the ultimate target. This is necessary because it may be impossible for the local
1852 > to determine the IP address of the
1853 ultimate target (that's often what gateways are used for).
1856 > You should prefer using IP addresses over DNS names, because the address lookups take
1857 time. All DNS names must resolve! You can <I
1860 > use domain patterns
1864 > or partial domain names. If a DNS name resolves to multiple
1865 IP addresses, only the first one is used.
1868 > Denying access to particular sites by ACL may have undesired side effects
1869 if the site in question is hosted on a machine which also hosts other sites.
1876 > Explicitly define the default behavior if no ACL and
1884 is OK. The absence of a <TT
1893 > destination addresses are OK:
1904 > permit-access localhost</PRE
1911 > Allow any host on the same class C subnet as www.privoxy.org access to
1912 nothing but www.example.com:
1923 > permit-access www.privoxy.org/24 www.example.com/32</PRE
1930 > Allow access from any host on the 26-bit subnet 192.168.45.64 to anywhere,
1931 with the exception that 192.168.45.73 may not access www.dirty-stuff.example.com:
1942 > permit-access 192.168.45.64/26
1943 deny-access 192.168.45.73 www.dirty-stuff.example.com</PRE
1959 >7.4.6. buffer-limit</A
1964 CLASS="VARIABLELIST"
1970 > Maximum size of the buffer for content filtering.
1986 >Effect if unset:</DT
1989 > Use a 4MB (4096 KB) limit.
1996 > For content filtering, i.e. the <TT
2003 > actions, it is necessary that
2007 > buffers the entire document body.
2008 This can be potentially dangerous, since a server could just keep sending
2009 data indefinitely and wait for your RAM to exhaust -- with nasty consequences.
2013 > When a document buffer size reaches the <TT
2017 flushed to the client unfiltered and no further attempt to
2018 filter the rest of the document is made. Remember that there may be multiple threads
2019 running, which might require up to <TT
2026 >, unless you have enabled <SPAN
2028 >"single-threaded"</SPAN
2046 > This feature allows routing of HTTP requests through a chain of
2048 It can be used to better protect privacy and confidentiality when
2049 accessing specific domains by routing requests to those domains
2050 through an anonymous public proxy (see e.g. <A
2051 HREF="http://www.multiproxy.org/anon_list.htm"
2053 >http://www.multiproxy.org/anon_list.htm</A
2055 Or to use a caching proxy to speed up browsing. Or chaining to a parent
2056 proxy may be necessary because the machine that <SPAN
2060 runs on has no direct Internet access.</P
2062 > Also specified here are SOCKS proxies. <SPAN
2066 supports the SOCKS 4 and SOCKS 4A protocols.</P
2078 CLASS="VARIABLELIST"
2084 > To which parent HTTP proxy specific requests should be routed.
2120 > is a domain name pattern (see the
2121 chapter on domain matching in the <TT
2130 > is the address of the parent HTTP proxy
2131 as an IP addresses in dotted decimal notation or as a valid DNS name (or <SPAN
2137 >"no forwarding"</SPAN
2144 > parameters are TCP ports, i.e. integer
2145 values from 1 to 64535
2158 >Effect if unset:</DT
2161 > Don't use parent HTTP proxies.
2176 >, then requests are not
2177 forwarded to another HTTP proxy but are made directly to the web servers.
2180 > Multiple lines are OK, they are checked in sequence, and the last match wins.
2187 > Everything goes to an example anonymizing proxy, except SSL on port 443 (which it doesn't handle):
2198 > forward .* anon-proxy.example.org:8080
2206 > Everything goes to our example ISP's caching proxy, except for requests
2207 to that ISP's sites:
2218 > forward .*. caching-proxy.example-isp.net:8000
2219 forward .example-isp.net .</PRE
2235 >7.5.2. forward-socks4 and forward-socks4a</A
2238 NAME="FORWARD-SOCKS4"
2241 NAME="FORWARD-SOCKS4A"
2246 CLASS="VARIABLELIST"
2252 > Through which SOCKS proxy (and to which parent HTTP proxy) specific requests should be routed.
2299 > is a domain name pattern (see the
2300 chapter on domain matching in the <TT
2315 are IP addresses in dotted decimal notation or valid DNS names (<TT
2326 >"no HTTP forwarding"</SPAN
2327 >), and the optional
2333 > parameters are TCP ports, i.e. integer values from 1 to 64535
2346 >Effect if unset:</DT
2349 > Don't use SOCKS proxies.
2356 > Multiple lines are OK, they are checked in sequence, and the last match wins.
2359 > The difference between <TT
2364 >forward-socks4a</TT
2366 is that in the SOCKS 4A protocol, the DNS resolution of the target hostname happens on the SOCKS
2367 server, while in SOCKS 4 it happens locally.
2378 >, then requests are not
2379 forwarded to another HTTP proxy but are made (HTTP-wise) directly to the web servers, albeit through
2387 > From the company example.com, direct connections are made to all
2391 > domains, but everything outbound goes through
2392 their ISP's proxy by way of example.com's corporate SOCKS 4A gateway to
2404 > forward-socks4a .*. socks-gw.example.com:1080 www-cache.example-isp.net:8080
2405 forward .example.com .</PRE
2412 > A rule that uses a SOCKS 4 gateway for all destinations but no HTTP parent looks like this:
2423 > forward-socks4 .*. socks-gw.example.com:1080 .</PRE
2438 NAME="ADVANCED-FORWARDING-EXAMPLES"
2439 >7.5.3. Advanced Forwarding Examples</A
2442 > If you have links to multiple ISPs that provide various special content
2443 only to their subscribers, you can configure multiple <SPAN
2447 which have connections to the respective ISPs to act as forwarders to each other, so that
2451 > users can see the internal content of all ISPs.</P
2453 > Assume that host-a has a PPP connection to isp-a.net. And host-b has a PPP connection to
2454 isp-b.net. Both run <SPAN
2458 configuration can look like this:</P
2471 forward .isp-b.net host-b:8118</PRE
2488 forward .isp-a.net host-a:8118</PRE
2494 > Now, your users can set their browser's proxy to use either
2495 host-a or host-b and be able to browse the internal content
2496 of both isp-a and isp-b.</P
2498 > If you intend to chain <SPAN
2505 > locally, then chain as
2508 >browser -> squid -> privoxy</TT
2509 > is the recommended way. </P
2511 > Assuming that <SPAN
2518 run on the same box, your squid configuration could then look like this:</P
2528 > # Define Privoxy as parent proxy (without ICP)
2529 cache_peer 127.0.0.1 parent 8118 7 no-query
2531 # Define ACL for protocol FTP
2534 # Do not forward FTP requests to Privoxy
2535 always_direct allow ftp
2537 # Forward all the rest to Privoxy
2538 never_direct allow all</PRE
2544 > You would then need to change your browser's proxy settings to <SPAN
2547 >'s address and port.
2548 Squid normally uses port 3128. If unsure consult <TT
2563 >7.6. Windows GUI Options</A
2569 > has a number of options specific to the
2570 Windows GUI interface:</P
2572 NAME="ACTIVITY-ANIMATION"
2577 >"activity-animation"</SPAN
2582 > icon will animate when
2586 > is active. To turn off, set to 0.</P
2591 CLASS="LITERALLAYOUT"
2594 >activity-animation 1</I
2596 </P
2606 >"log-messages"</SPAN
2611 > will log messages to the console
2617 CLASS="LITERALLAYOUT"
2622 </P
2627 NAME="LOG-BUFFER-SIZE"
2633 >"log-buffer-size"</SPAN
2634 > is set to 1, the size of the log buffer,
2635 i.e. the amount of memory used for the log messages displayed in the
2636 console window, will be limited to <SPAN
2638 >"log-max-lines"</SPAN
2641 > Warning: Setting this to 0 will result in the buffer to grow infinitely and
2642 eat up all your memory!</P
2647 CLASS="LITERALLAYOUT"
2650 >log-buffer-size 1</I
2652 </P
2657 NAME="LOG-MAX-LINES"
2662 >log-max-lines</SPAN
2663 > is the maximum number of lines held
2664 in the log buffer. See above.</P
2669 CLASS="LITERALLAYOUT"
2672 >log-max-lines 200</I
2674 </P
2679 NAME="LOG-HIGHLIGHT-MESSAGES"
2684 >"log-highlight-messages"</SPAN
2689 > will highlight portions of the log
2690 messages with a bold-faced font:</P
2695 CLASS="LITERALLAYOUT"
2698 >log-highlight-messages 1</I
2700 </P
2705 NAME="LOG-FONT-NAME"
2708 > The font used in the console window:</P
2713 CLASS="LITERALLAYOUT"
2716 >log-font-name Comic Sans MS</I
2718 </P
2723 NAME="LOG-FONT-SIZE"
2726 > Font size used in the console window:</P
2731 CLASS="LITERALLAYOUT"
2736 </P
2741 NAME="SHOW-ON-TASK-BAR"
2747 >"show-on-task-bar"</SPAN
2748 > controls whether or not
2752 > will appear as a button on the Task bar
2758 CLASS="LITERALLAYOUT"
2761 >show-on-task-bar 0</I
2763 </P
2768 NAME="CLOSE-BUTTON-MINIMIZES"
2773 >"close-button-minimizes"</SPAN
2774 > is set to 1, the Windows close
2775 button will minimize <SPAN
2778 > instead of closing
2779 the program (close with the exit option on the File menu).</P
2784 CLASS="LITERALLAYOUT"
2787 >close-button-minimizes 1</I
2789 </P
2799 >"hide-console"</SPAN
2800 > option is specific to the MS-Win console
2804 >. If this option is used,
2808 > will disconnect from and hide the
2814 CLASS="LITERALLAYOUT"
2819 </P
2840 HREF="configuration.html"
2856 HREF="actions-file.html"