3proxy.cfg.sample 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. #!/usr/local/bin/3proxy
  2. # Yes, 3proxy.cfg can be executable, in this case you should place
  3. # something like
  4. #config /usr/local/3proxy/3proxy.cfg
  5. # to show which configuration 3proxy should re-read on realod.
  6. #system "echo Hello world!"
  7. # you may use system to execute some external command if proxy starts
  8. # We can configure nservers to avoid unsafe gethostbyname() usage
  9. nserver 10.1.2.1
  10. nserver 10.2.2.2
  11. # nscache is good to save speed, traffic and bandwidth
  12. nscache 65536
  13. #nsrecord porno.security.nnov.ru 0.0.0.0
  14. # nobody will be able to access porno.security.nnov.ru by the name.
  15. #nsrecord wpad.security.nnov.ru www.security.nnov.ru
  16. # wpad.security.nnov.ru will resolve to www.security.nnov.ru for
  17. # clients
  18. timeouts 1 5 30 60 180 1800 15 60
  19. # Here we can change timeout values
  20. users 3APA3A:CL:3apa3a "test:CR:$1$qwer$CHFTUFGqkjue9HyhcMHEe1"
  21. # note that "" required, overvise $... is treated as include file name.
  22. # $1$qwer$CHFTUFGqkjue9HyhcMHEe1 is 'test' in MD5 crypt format.
  23. #users $/usr/local/etc/3proxy/passwd
  24. # this example shows you how to include passwd file. For included files
  25. # <CR> and <LF> are treated as field separators.
  26. #daemon
  27. # now we will not depend on any console (daemonize). daemon must be given
  28. # before any significant command on *nix.
  29. service
  30. # service is required under NT if you want 3proxy to start as service
  31. #log /usr/local/etc/3proxy/logs/3proxy.log D
  32. log c:\3proxy\logs\3proxy.log D
  33. # log allows to specify log file location and rotation, D means logfile
  34. # is created daily
  35. #logformat "L%d-%m-%Y %H:%M:%S %z %N.%p %E %U %C:%c %R:%r %O %I %h %T"
  36. #logformat "Linsert into log (l_date, l_user, l_service, l_in, l_out, l_descr) values ('%d-%m-%Y %H:%M:%S', '%U', '%N', %I, %O, '%T')"
  37. #Compatible with Squid access.log:
  38. #
  39. #"- +_G%t.%. %D %C TCP_MISS/200 %I %1-1T %2-2T %U DIRECT/%R application/unknown"
  40. #or, more compatible format without %D
  41. #"- +_G%t.%. 1 %C TCP_MISS/200 %I %1-1T %2-2T %U DIRECT/%R application/unknown"
  42. #
  43. #Compatible with ISA 2000 proxy WEBEXTD.LOG (fields are TAB-delimited):
  44. #
  45. #"- + L%C %U Unknown Y %Y-%m-%d %H:%M:%S w3proxy 3PROXY - %n %R %r %D %O %I http TCP %1-1T %2-2T - - %E - - -"
  46. #
  47. #Compatible with ISA 2004 proxy WEB.w3c
  48. #
  49. #"- + L%C %U Unknown %Y-%m-%d %H:%M:%S 3PROXY - %n %R %r %D %O %I http %1-1T %2-2T - %E - - Internal External 0x0 Allowed"
  50. #
  51. #Compatible with ISA 2000/2004 firewall FWSEXTD.log (fields are TAB-delimited):
  52. #
  53. #"- + L%C %U unnknown:0:0.0 N %Y-%m-%d %H:%M:%S fwsrv 3PROXY - %n %R %r %D %O %I %r TCP Connect - - - %E - - - - -"
  54. #
  55. #Compatible with HTTPD standard log (Apache and others)
  56. #
  57. #"-""+_L%C - %U [%d/%o/%Y:%H:%M:%S %z] ""%T"" %E %I"
  58. #or more compatible without error code
  59. #"-""+_L%C - %U [%d/%o/%Y:%H:%M:%S %z] ""%T"" 200 %I"
  60. # in log file we want to have underscores instead of spaces
  61. logformat "- +_L%t.%. %N.%p %E %U %C:%c %R:%r %O %I %h %T"
  62. #archiver gz /bin/gzip %F
  63. #archiver zip zip -m -qq %A %F
  64. #archiver zip pkzipc -add -silent -move %A %F
  65. archiver rar rar a -df -inul %A %F
  66. # if archiver specified log file will be compressed after closing.
  67. # you should specify extension, path to archiver and command line, %A will be
  68. # substituted with archive file name, %f - with original file name.
  69. # Original file will not be removed, so archiver should care about it.
  70. rotate 30
  71. # We will keep last 30 log files
  72. auth iponly
  73. #auth nbname
  74. #auth strong
  75. # auth specifies type of user authentication. If you specify none proxy
  76. # will not do anything to check name of the user. If you specify
  77. # nbname proxy will send NetBIOS name request packet to UDP/137 of
  78. # client and parse request for NetBIOS name of messanger service.
  79. # Strong means that proxy will check password. For strong authentication
  80. # unknown user will not be allowed to use proxy regardless of ACL.
  81. # If you do not want username to be checked but wanna ACL to work you should
  82. # specify auth iponly.
  83. #allow ADMINISTRATOR,root
  84. #allow * 127.0.0.1,192.168.1.1 * *
  85. #parent 1000 http 192.168.1.2 80 * * * 80
  86. #allow * 192.168.1.0/24 * 25,53,110,20-21,1024-65535
  87. # we will allow everything if username matches ADMINISTRATOR or root or
  88. # client ip is 127.0.0.1 or 192.168.1.1. Overwise we will redirect any request
  89. # to port 80 to our Web-server 192.168.0.2.
  90. # We will allow any outgoing connections from network 192.168.1.0/24 to
  91. # SMTP, POP3, FTP, DNS and unprivileged ports.
  92. # Note, that redirect may also be used with proxy or portmapper. It will
  93. # allow you to redirect requests to different ports or different server
  94. # for different clients.
  95. # sharing access to internet
  96. external 10.1.1.1
  97. # external is address 3proxy uses for outgoing connections. 0.0.0.0 means any
  98. # interface. Using 0.0.0.0 is not good because it allows to connect to 127.0.0.1
  99. internal 192.168.1.1
  100. # internal is address of interface proxy will listen for incoming requests
  101. # 127.0.0.1 means only localhost will be able to use this proxy. This is
  102. # address you should specify for clients as proxy IP.
  103. # You MAY use 0.0.0.0 but you shouldn't, because it's a chance for you to
  104. # have open proxy in your network in this case.
  105. auth none
  106. # no authentication is requires
  107. dnspr
  108. # dnsproxy listens on UDP/53 to answer client's DNS requests. It requires
  109. # nserver/nscache configuration.
  110. #external $./external.ip
  111. #internal $./internal.ip
  112. # this is just an alternative form fo giving external and internal address
  113. # allows you to read this addresses from files
  114. auth strong
  115. # We want to protect internal interface
  116. deny * * 127.0.0.1,192.168.1.1
  117. # and llow HTTP and HTTPS traffic.
  118. allow * * * 80-88,8080-8088 HTTP
  119. allow * * * 443,8443 HTTPS
  120. proxy -n
  121. auth none
  122. # pop3p will be used without any authentication. It's bad choice
  123. # because it's possible to use pop3p to access any port
  124. pop3p
  125. tcppm 25 mail.my.provider 25
  126. #udppm -s 53 ns.my.provider 53
  127. # we can portmap port TCP/25 to provider's SMTP server and UDP/53
  128. # to provider's DNS.
  129. # Now we can use our proxy as SMTP and DNS server.
  130. # -s switch for UDP means "single packet" service - instead of setting
  131. # association for period of time association will only be set for 1 packet.
  132. # It's very userfull for services like DNS but not for some massive services
  133. # like multimedia streams or online games.
  134. auth strong
  135. flush
  136. allow 3APA3A,test
  137. maxconn 20
  138. socks
  139. # for socks we will use password authentication and different access control -
  140. # we flush previously configured ACL list and create new one to allow users
  141. # test and 3APA3A to connect from any location
  142. auth strong
  143. flush
  144. internal 127.0.0.1
  145. allow 3APA3A 127.0.0.1
  146. maxconn 3
  147. admin
  148. #only allow acces to admin interface for user 3APA3A from 127.0.0.1 address
  149. #via 127.0.0.1 address.
  150. # map external 80 and 443 ports to internal Web server
  151. # examples below show how to use 3proxy to publish Web server in internal
  152. # network to Internet. We must switch internal and external addresses and
  153. # flush any ACLs
  154. #auth none
  155. #flush
  156. #external $./internal.ip
  157. #internal $./external.ip
  158. #maxconn 300
  159. #tcppm 80 websrv 80
  160. #tcppm 443 websrv 443
  161. #chroot /usr/local/jail
  162. #setgid 65535
  163. #setuid 65535
  164. # now we needn't any root rights. We can chroot and setgid/setuid.
  165. ###$Id: 3proxy.cfg.sample,v 1.7 2006/11/18 14:37:06 vlad Exp $#######