Squid refuses all websites when creating proxy server
Asked Answered
P

3

12

so I'm trying to create a proxy server for my crawler to use, and I'm unsure about why I'm getting denied from even myself. When I go to any website in a browser, on the computer that I've installed Squid and everything on, it's giving me the following error message:

ERROR

The requested URL could not be retrieved

While trying to retrieve the URL: http://www.whatismyipaddress.com/

The following error was encountered:

Access Denied.
Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect.

Your cache administrator is webmaster. 
Generated Sun, 08 Nov 2015 04:03:13 GMT by WIN-AIUOBK0JHPA (squid/2.7.STABLE8)

I've edited my LAN settings in Internet Options to allow for a proxy server at the correct IP address (IPv4 when I run ipconfig), gave it the correct port to open up to, and I've also opened up the port in my Windows Firewall.

Below are segments of my squid.conf file:

acl SSL_ports port 443
acl Safe_ports port 80      # http
acl Safe_ports port 21      # ftp
acl Safe_ports port 443     # https
acl Safe_ports port 70      # gopher
acl Safe_ports port 210     # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280     # http-mgmt
acl Safe_ports port 488     # gss-http
acl Safe_ports port 591     # filemaker
acl Safe_ports port 777     # multiling http
acl CONNECT method CONNECT

acl localhost src 192.168.1.0/255.255.255.255 
http_access allow localhost

(skip through some commented out segments....)

http_access allow manager localhost

http_access allow localnet

As you can tell, I've stripped out a lot of unnecessary commented parts. Down lower, I have my...

http_port ####

...line.

I have no idea why I'm getting blocked out. I will be constantly refreshing, so if you need any more information or have any questions, please let me know. Thank you so much!!

Preachy answered 8/11, 2015 at 4:35 Comment(1)
Have you fixed this? I'm getting same error message and searching for a solution but can not find reason.Spada
C
5

your config should somewhat look like below

http_access allow localhost 
http_access allow localnet 
# And finally deny all other access to this proxy 
http_access deny all

and remove the following line from your config

acl localhost src 192.168.1.0/255.255.255.255 

localhost need not to be specified as ACL its just for accessing localhost pages. You have mixed up localhost with localnet, modify that line like below

acl localnet src 192.168.1.0/255.255.255.255 

your lan clients local ip that hitting the proxy should belong to the above mentioned src range or modify the range as you require. all other requests from other ips will be denied

Cumine answered 20/11, 2015 at 9:10 Comment(0)
A
1

I just got rid of all the default config and used the following:

# cat /etc/squid/squid.conf
http_port 3128
acl vpc_no_internet src 10.130.0.0/255.255.0.0
http_access allow vpc_no_internet
coredump_dir /var/spool/squid
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern (Release|Packages(.gz)*)$      0       20%     2880
refresh_pattern .               0       20%     4320

Note: The above config allows access for the specified subnet only.

Associate answered 5/6, 2018 at 5:20 Comment(0)
B
1

I had a similar situation and the solution was to use the following commands:

unset https_proxy

unset http_proxy

unset ftp_proxy

I placed these into a script to run every time I logged in to my server. This may not be the correct solution for you but it worked in my situation as I wasn't using the proxy and was connecting via vpn.

The only reason I am posting this is I haven't seen this answer posted anywhere else. As usual, YMMV.

Bier answered 19/5, 2022 at 9:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.