P
P
Peter2015-09-19 18:43:45
FreeBSD
Peter, 2015-09-19 18:43:45

How to configure squid proxy server correctly?

squid3 config

acl CONNECT method CONNECT
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 210         # wais
acl Safe_ports port 21          # ftp
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 443         # https
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 70          # gopher
acl Safe_ports port 777         # multiling http
acl Safe_ports port 80          # http
acl SSL_ports port 443
coredump_dir /var/spool/squid3
http_access allow localhost
http_access allow localhost manager
http_access allo  all
http_access deny CONNECT !SSL_ports
http_access deny manager
http_access deny !Safe_ports
http_port 3128
refresh_pattern .               0       20%     4320
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
url_rewrite_program /usr/bin/squidGuard -c /etc/squid3/squidGuard.conf
url_rewrite_children 500
dns_nameservers 8.8.8.8 8.8.4.4
# ICAP Configurations
icap_enable on
icap_preview_enable on
icap_service service_req reqmod_precache bypass=0 icap://127.0.0.1:1344/reqmod
adaptation_access service_req allow all
icap_service service_resp respmod_precache bypass=0 icap://127.0.0.1:1344/respmod
adaptation_access service_resp allow all

If on a machine where windows is installed as an OS, specify a proxy server in the browser, then it seems like the proxy works.
If you try on another machine where Ubuntu stands through Iptables, let traffic through a proxy
iptables -t nat -D OUTPUT -p tcp --dport 80 -j DNAT --to-destination %PROXY_IP%:3128

then the proxy server gives an error in the browser
ERROR
The requested URL could not be retrieved

While trying to retrieve the URL: /

The following error was encountered:

    * Invalid URL 

Some aspect of the requested URL is incorrect. Possible problems:

    * Missing or incorrect access protocol (should be `http://'' or similar)
    * Missing hostname
    * Illegal double-escape in the URL-Path
    * Illegal character in hostname; underscores are not allowed

Please tell me how to set everything up correctly? And make a transparent proxy server?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ruslan Fedoseev, 2015-09-19
@martin74ua

habrahabr.ru/sandbox/39160
keyword:
http_port 3128 transparent
If you write a proxy in the browser on Ubuntu, then everything will work too

O
oia, 2015-09-19
@oia

why touch Iptables if you have a proxy

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question