tinyproxy.conf 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. # BasicAuth: HTTP "Basic Authentication" for accessing the proxy.
  2. # If there are any entries specified, access is only granted for authenticated
  3. # users.
  4. BasicAuth user password
  5. ##
  6. ## tinyproxy.conf -- tinyproxy daemon configuration file
  7. ##
  8. ## This example tinyproxy.conf file contains example settings
  9. ## with explanations in comments. For decriptions of all
  10. ## parameters, see the tinproxy.conf(5) manual page.
  11. ##
  12. #
  13. # User/Group: This allows you to set the user and group that will be
  14. # used for tinyproxy after the initial binding to the port has been done
  15. # as the root user. Either the user or group name or the UID or GID
  16. # number may be used.
  17. #
  18. User tinyproxy
  19. Group tinyproxy
  20. #
  21. # Port: Specify the port which tinyproxy will listen on. Please note
  22. # that should you choose to run on a port lower than 1024 you will need
  23. # to start tinyproxy using root.
  24. #
  25. Port 8888
  26. #
  27. # Listen: If you have multiple interfaces this allows you to bind to
  28. # only one. If this is commented out, tinyproxy will bind to all
  29. # interfaces present.
  30. #
  31. #Listen 192.168.0.1
  32. #
  33. # Bind: This allows you to specify which interface will be used for
  34. # outgoing connections. This is useful for multi-home'd machines where
  35. # you want all traffic to appear outgoing from one particular interface.
  36. #
  37. #Bind 192.168.0.1
  38. #
  39. # BindSame: If enabled, tinyproxy will bind the outgoing connection to the
  40. # ip address of the incoming connection.
  41. #
  42. #BindSame yes
  43. #
  44. # Timeout: The maximum number of seconds of inactivity a connection is
  45. # allowed to have before it is closed by tinyproxy.
  46. #
  47. Timeout 600
  48. #
  49. # ErrorFile: Defines the HTML file to send when a given HTTP error
  50. # occurs. You will probably need to customize the location to your
  51. # particular install. The usual locations to check are:
  52. # /usr/local/share/tinyproxy
  53. # /usr/share/tinyproxy
  54. # /etc/tinyproxy
  55. #
  56. #ErrorFile 404 "/usr/share/tinyproxy/404.html"
  57. #ErrorFile 400 "/usr/share/tinyproxy/400.html"
  58. #ErrorFile 503 "/usr/share/tinyproxy/503.html"
  59. #ErrorFile 403 "/usr/share/tinyproxy/403.html"
  60. #ErrorFile 408 "/usr/share/tinyproxy/408.html"
  61. #
  62. # DefaultErrorFile: The HTML file that gets sent if there is no
  63. # HTML file defined with an ErrorFile keyword for the HTTP error
  64. # that has occured.
  65. #
  66. DefaultErrorFile "/usr/share/tinyproxy/default.html"
  67. #
  68. # StatHost: This configures the host name or IP address that is treated
  69. # as the stat host: Whenever a request for this host is received,
  70. # Tinyproxy will return an internal statistics page instead of
  71. # forwarding the request to that host. The default value of StatHost is
  72. # tinyproxy.stats.
  73. #
  74. #StatHost "tinyproxy.stats"
  75. #
  76. #
  77. # StatFile: The HTML file that gets sent when a request is made
  78. # for the stathost. If this file doesn't exist a basic page is
  79. # hardcoded in tinyproxy.
  80. #
  81. StatFile "/usr/share/tinyproxy/stats.html"
  82. #
  83. # LogFile: Allows you to specify the location where information should
  84. # be logged to. If you would prefer to log to syslog, then disable this
  85. # and enable the Syslog directive. These directives are mutually
  86. # exclusive. If neither Syslog nor LogFile are specified, output goes
  87. # to stdout.
  88. #
  89. #LogFile "/var/log/tinyproxy/tinyproxy.log"
  90. #
  91. # Syslog: Tell tinyproxy to use syslog instead of a logfile. This
  92. # option must not be enabled if the Logfile directive is being used.
  93. # These two directives are mutually exclusive.
  94. #
  95. #Syslog On
  96. #
  97. # LogLevel: Warning
  98. #
  99. # Set the logging level. Allowed settings are:
  100. # Critical (least verbose)
  101. # Error
  102. # Warning
  103. # Notice
  104. # Connect (to log connections without Info's noise)
  105. # Info (most verbose)
  106. #
  107. # The LogLevel logs from the set level and above. For example, if the
  108. # LogLevel was set to Warning, then all log messages from Warning to
  109. # Critical would be output, but Notice and below would be suppressed.
  110. #
  111. LogLevel Info
  112. #
  113. # PidFile: Write the PID of the main tinyproxy thread to this file so it
  114. # can be used for signalling purposes.
  115. # If not specified, no pidfile will be written.
  116. #
  117. #PidFile "/var/run/tinyproxy/tinyproxy.pid"
  118. #
  119. # XTinyproxy: Tell Tinyproxy to include the X-Tinyproxy header, which
  120. # contains the client's IP address.
  121. #
  122. #XTinyproxy Yes
  123. #
  124. # Upstream:
  125. #
  126. # Turns on upstream proxy support.
  127. #
  128. # The upstream rules allow you to selectively route upstream connections
  129. # based on the host/domain of the site being accessed.
  130. #
  131. # Syntax: upstream type (user:pass@)ip:port ("domain")
  132. # Or: upstream none "domain"
  133. # The parts in parens are optional.
  134. # Possible types are http, socks4, socks5, none
  135. #
  136. # For example:
  137. # # connection to test domain goes through testproxy
  138. # upstream http testproxy:8008 ".test.domain.invalid"
  139. # upstream http testproxy:8008 ".our_testbed.example.com"
  140. # upstream http testproxy:8008 "192.168.128.0/255.255.254.0"
  141. #
  142. # # upstream proxy using basic authentication
  143. # upstream http user:pass@testproxy:8008 ".test.domain.invalid"
  144. #
  145. # # no upstream proxy for internal websites and unqualified hosts
  146. # upstream none ".internal.example.com"
  147. # upstream none "www.example.com"
  148. # upstream none "10.0.0.0/8"
  149. # upstream none "192.168.0.0/255.255.254.0"
  150. # upstream none "."
  151. #
  152. # # connection to these boxes go through their DMZ firewalls
  153. # upstream http cust1_firewall:8008 "testbed_for_cust1"
  154. # upstream http cust2_firewall:8008 "testbed_for_cust2"
  155. #
  156. # # default upstream is internet firewall
  157. # upstream http firewall.internal.example.com:80
  158. #
  159. # You may also use SOCKS4/SOCKS5 upstream proxies:
  160. # upstream socks4 127.0.0.1:9050
  161. # upstream socks5 socksproxy:1080
  162. #
  163. # The LAST matching rule wins the route decision. As you can see, you
  164. # can use a host, or a domain:
  165. # name matches host exactly
  166. # .name matches any host in domain "name"
  167. # . matches any host with no domain (in 'empty' domain)
  168. # IP/bits matches network/mask
  169. # IP/mask matches network/mask
  170. #
  171. #Upstream http some.remote.proxy:port
  172. #
  173. # MaxClients: This is the absolute highest number of threads which will
  174. # be created. In other words, only MaxClients number of clients can be
  175. # connected at the same time.
  176. #
  177. MaxClients 100
  178. #
  179. # MinSpareServers/MaxSpareServers: These settings set the upper and
  180. # lower limit for the number of spare servers which should be available.
  181. #
  182. # If the number of spare servers falls below MinSpareServers then new
  183. # server processes will be spawned. If the number of servers exceeds
  184. # MaxSpareServers then the extras will be killed off.
  185. #
  186. MinSpareServers 5
  187. MaxSpareServers 20
  188. #
  189. # StartServers: The number of servers to start initially.
  190. #
  191. StartServers 10
  192. #
  193. # MaxRequestsPerChild: The number of connections a thread will handle
  194. # before it is killed. In practise this should be set to 0, which
  195. # disables thread reaping. If you do notice problems with memory
  196. # leakage, then set this to something like 10000.
  197. #
  198. MaxRequestsPerChild 0
  199. #
  200. # Allow: Customization of authorization controls. If there are any
  201. # access control keywords then the default action is to DENY. Otherwise,
  202. # the default action is ALLOW.
  203. #
  204. # The order of the controls are important. All incoming connections are
  205. # tested against the controls based on order.
  206. #
  207. #Allow 127.0.0.1
  208. # BasicAuth: HTTP "Basic Authentication" for accessing the proxy.
  209. # If there are any entries specified, access is only granted for authenticated
  210. # users.
  211. #BasicAuth user password
  212. #
  213. # AddHeader: Adds the specified headers to outgoing HTTP requests that
  214. # Tinyproxy makes. Note that this option will not work for HTTPS
  215. # traffic, as Tinyproxy has no control over what headers are exchanged.
  216. #
  217. #AddHeader "X-My-Header" "Powered by Tinyproxy"
  218. #
  219. # ViaProxyName: The "Via" header is required by the HTTP RFC, but using
  220. # the real host name is a security concern. If the following directive
  221. # is enabled, the string supplied will be used as the host name in the
  222. # Via header; otherwise, the server's host name will be used.
  223. #
  224. ViaProxyName "tinyproxy"
  225. #
  226. # DisableViaHeader: When this is set to yes, Tinyproxy does NOT add
  227. # the Via header to the requests. This virtually puts Tinyproxy into
  228. # stealth mode. Note that RFC 2616 requires proxies to set the Via
  229. # header, so by enabling this option, you break compliance.
  230. # Don't disable the Via header unless you know what you are doing...
  231. #
  232. DisableViaHeader Yes
  233. #
  234. # Filter: This allows you to specify the location of the filter file.
  235. #
  236. #Filter "/etc/tinyproxy/filter"
  237. #
  238. # FilterURLs: Filter based on URLs rather than domains.
  239. #
  240. #FilterURLs On
  241. #
  242. # FilterExtended: Use POSIX Extended regular expressions rather than
  243. # basic.
  244. #
  245. #FilterExtended On
  246. #
  247. # FilterCaseSensitive: Use case sensitive regular expressions.
  248. #
  249. #FilterCaseSensitive On
  250. #
  251. # FilterDefaultDeny: Change the default policy of the filtering system.
  252. # If this directive is commented out, or is set to "No" then the default
  253. # policy is to allow everything which is not specifically denied by the
  254. # filter file.
  255. #
  256. # However, by setting this directive to "Yes" the default policy becomes
  257. # to deny everything which is _not_ specifically allowed by the filter
  258. # file.
  259. #
  260. #FilterDefaultDeny Yes
  261. #
  262. # Anonymous: If an Anonymous keyword is present, then anonymous proxying
  263. # is enabled. The headers listed are allowed through, while all others
  264. # are denied. If no Anonymous keyword is present, then all headers are
  265. # allowed through. You must include quotes around the headers.
  266. #
  267. # Most sites require cookies to be enabled for them to work correctly, so
  268. # you will need to allow Cookies through if you access those sites.
  269. #
  270. #Anonymous "Host"
  271. #Anonymous "Authorization"
  272. #Anonymous "Cookie"
  273. #
  274. # ConnectPort: This is a list of ports allowed by tinyproxy when the
  275. # CONNECT method is used. To disable the CONNECT method altogether, set
  276. # the value to 0. If no ConnectPort line is found, all ports are
  277. # allowed.
  278. #
  279. # The following two ports are used by SSL.
  280. #
  281. #ConnectPort 443
  282. #ConnectPort 563
  283. #
  284. # Configure one or more ReversePath directives to enable reverse proxy
  285. # support. With reverse proxying it's possible to make a number of
  286. # sites appear as if they were part of a single site.
  287. #
  288. # If you uncomment the following two directives and run tinyproxy
  289. # on your own computer at port 8888, you can access Google using
  290. # http://localhost:8888/google/ and Wired News using
  291. # http://localhost:8888/wired/news/. Neither will actually work
  292. # until you uncomment ReverseMagic as they use absolute linking.
  293. #
  294. #ReversePath "/google/" "http://www.google.com/"
  295. #ReversePath "/wired/" "http://www.wired.com/"
  296. #
  297. # When using tinyproxy as a reverse proxy, it is STRONGLY recommended
  298. # that the normal proxy is turned off by uncommenting the next directive.
  299. #
  300. #ReverseOnly Yes
  301. #
  302. # Use a cookie to track reverse proxy mappings. If you need to reverse
  303. # proxy sites which have absolute links you must uncomment this.
  304. #
  305. #ReverseMagic Yes
  306. #
  307. # The URL that's used to access this reverse proxy. The URL is used to
  308. # rewrite HTTP redirects so that they won't escape the proxy. If you
  309. # have a chain of reverse proxies, you'll need to put the outermost
  310. # URL here (the address which the end user types into his/her browser).
  311. #
  312. # If not set then no rewriting occurs.
  313. #
  314. #ReverseBaseURL "http://localhost:8888/"