squid as reverse proxy
boris at boris-glawe.de
Thu Aug 3 15:05:22 UTC 2006
I'm going to use squid as a reverse proxy.
There's one machine, that's visible in the internet: 192.168.1.100.
Incoming requests on port 80 from the internet are forwarded by the
router to this machine. On this machine I am running squid, which also
listens on port 80.
The machine, that is running the webserer is 192.168.1.98 (also on Port 80).
In my squid.conf on 192.168.1.100 I have set the httpd_accel_host to
192.168.1.98 an httpd_accel_port to 80, which says "forward all requests
on port 80 to the machine 192.168.1.98:80.
When I enter our url (http://ourname.dyndns.org/ or
http://<our-ip-address>/ ) in a webbrowser, which is running on machine
in the internet, we get the apache test page, which is configured with
fedora's apache installation. Thus our forwarding seems to work.
But when I enter our url in this way: http://ourname.dyndns.org/ourcms,
it's not the proxy that answers the request, but the browser tries to
contact the webserver 192.168.1.98 directly, which is of course not
visible in the internet.
When I enter an invalid url like
http://ourname.dyndns.org/asfddkfljghdsf, I receive an 404 "not found"
error as expected.
Contacting the webserver directly is definitely not what a reverse proxy
is made for!?
What can I do?
thanks and greets
P.S. I'm attaching our squid.conf:
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
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
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access allow localhost
http_access allow all
http_reply_access allow all
icp_access allow all
More information about the users