4

So I am trying to setup a squid as an HTTP proxy. This proxy is for testing purposes only and on an internal network, unreachable from outside. I can connect to the proxy fine, but Squid 403's every HTTP request. In a quick and dirty attempt to just connect, I added the following lines to squid.conf:

acl all src 0.0.0.0/0.0.0.0
http_access allow all

I still get 403's for every HTTP request. Wondering if anyone knows whats up?

Internal network is on the 10.0.0.0/8 block. let me now if more info is needed.

NOTE: I don't need squid to do anything extra fancy, literally just act as a simple HTTP proxy.

1
  • What did you find in your squid log files? The HTTP error code is not enough to know what is going on.
    – Khaled
    Oct 18, 2011 at 18:26

1 Answer 1

7

Without seeing your entire configuration I can only guess as to what the problem might be, but here's a few helpful tips and potential gotchas when working with squid.

ACL's are done in order, so if you have any ACLs before those two that are 'deny' I would check them first.

By default squid logs to /usr/local/squid/var/logs/access.log which can provide helpful hints as too why you might be seeing 403's. You may also want to try to add these lines, these are out of my config for when I need to debug something, they've proven very useful in the past

# <Client IP> <Username> [<Local Time>] "<Request Method> <Request URL> HTTP/<Protocol Version> <Response Status Code> \
# <Sent reply size (with hdrs)> <Referer> <User Agent> <Squid Request Status>:<Squid Hierarchy Status>
logformat combined %>a %un [%tl] "%rm %ru HTTP/%rv" %>Hs %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh
access_log /var/log/squid/squid.log squid
access_log /var/log/squid/access.log combined

Those first two lines are a comment describing the format of the combined log. Make sure that /var/log/squid exists and that it's writable by whatever user your squid instance runs as.

If you use those lines, general squid errors will be redirected to /var/log/squid/squid.log and every request/response from clients to squid will be logged in /var/log/squid/access.log. If you have a lot of users using your proxy be careful turning that second access_log line on as it will generate HUGE logs.

Hope this helps :)

2
  • 1
    Oh an one more thing, I've found the squid documentation on individual commands in the config to be fantastic even if examples are a bit outdated. Here's the address for squid v3.1: squid-cache.org/Versions/v3/3.1/cfgman Oct 18, 2011 at 18:10
  • Thanks for the answer and link to the documentation. I finally got it working. I made the mistake of using the squid.conf.default and must have had some ACL's/http_access that stopped anyone from using the proxy. (plus editing an almost 5,000 line config is really annoying).
    – Snaxib
    Oct 18, 2011 at 18:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .