LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Squid reverse proxy? (https://www.linuxquestions.org/questions/linux-server-73/squid-reverse-proxy-861181/)

iuselinux 02-07-2011 09:53 AM

Squid reverse proxy?
 
So im trying to configure a reverse proxy on one of my VPS servers, and im using squid3, so this tutorial doesnt work > http://www.visolve.com/squid/whitepa...verseproxy.php

I have been looking at this one though > http://www.lesismore.co.za/squid3.html

Which seems to get me a lot closer.

My goal, is to get one domain to basically proxy to another, for example.. I want www.mydomain.com, to resolve to www.google.com. Much like a shell tunnel on port 80 would, only id rather use squid.

Here is my current configuration..
Quote:

root@me [/etc/squid]# egrep -v "^#" squid.conf | sed -e '/^$/d'
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
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
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow all
icp_access allow all
http_port 80 accel defaultsite=google.com
hierarchy_stoplist cgi-bin ?
cache_dir ufs /var/spool/squid 1000 16 256
access_log /var/log/squid/access.log squid
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
always_direct allow all
coredump_dir /var/spool/squid
This works ok, except it doesnt mask it, it simply redirects.. anyone have any tips?

iuselinux 02-07-2011 10:16 AM

Lmfao...

.. so I was testing with google, just like in above, and it was actually googles rewrite that was redirecting it to google... damnit

iuselinux 02-08-2011 10:01 AM

Im still having a bit of an issue. Im using the same config as whats above, only defaultsite=IP_OF_MAIN_SERVER.

Now when I pass the variable $_SERVER['HTTP_HOST'];, it shows the variable of the IP thats the default site, any way to make it show whats in the URL request?... Is this a squid configuration?

iuselinux 02-09-2011 09:31 AM

Any ideas?


All times are GMT -5. The time now is 04:46 PM.