Repository navigation
Expand file tree
/
Copy pathsquid.conf
More file actions
67 lines (48 loc) · 1.87 KB
/
Copy pathsquid.conf
File metadata and controls
67 lines (48 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Minimal Squid configuration for AI Proxy
# This configuration provides a basic forward proxy with CONNECT method support
# Access Control Lists
acl localhost src 127.0.0.1/32
acl localhost src ::1/128
acl localnet src 10.0.0.0/8 # RFC 1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC 1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC 1918 possible internal network
# Safe ports
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 443 # https
acl Safe_ports port 1025-65535 # unregistered ports
# CONNECT method for HTTPS
acl CONNECT method CONNECT
# Deny requests to unsafe ports
http_access deny !Safe_ports
# Deny CONNECT to non-SSL ports
http_access deny CONNECT !SSL_ports
# Allow localhost access
http_access allow localhost
# Allow local network access (adjust as needed for security)
http_access allow localnet
# Deny all other access
http_access deny all
# Listen on port 8888 instead of default 3128
http_port 8888
# Custom log format that includes the Host header
logformat aiproxy %ts.%03tu %6tr %>a %Ss/%03>Hs %<st %rm %ru %{Host}>h %un %Sh/%<a %mt
# Use our custom log format and specify log location
access_log /tmp/squid_access.log aiproxy
# Cache log location (avoid permission issues)
cache_log /tmp/ai-proxy-cache.log
# Disable cache to keep it simple (we're just proxying)
cache deny all
# Disable shared memory locking to avoid conflicts with system squid
# This is safe for a single-user proxy
workers 1
# Set the visible hostname
visible_hostname ai-proxy
# Cache directory (using temp directory to avoid permission issues)
cache_dir ufs /tmp/squid-cache 100 16 256
# PID file location (different from system squid)
pid_filename /tmp/ai-proxy-squid.pid
# Core dumps directory (for debugging if needed)
coredump_dir /tmp
# Don't add X-Forwarded-For header (privacy)
forwarded_for delete