<div dir="ltr"><div dir="ltr"><div>Thank you so much Matus,</div><div><br></div><div>we were indeed missing a DNS service:</div><div><br></div><div style="margin-left:40px">Your proxy is already listening on port 80 and 443 for directly<br>receiving traffic to any domain with a DNS entry of 192.168.0.188.</div><div><br></div><div>best,<br></div><div><br></div><div><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><b>Juan Carlos</b></div><div dir="ltr"><b><br></b></div><div dir="ltr"><b>Join our <a href="http://lists.mediaarchitecture.org/?p=subscribe&id=1" target="_blank">mailing list</a> (Max 1-mail / month)</b><br><br></div></div></div></div></div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">Am Mo., 22. Okt. 2018 um 15:12 Uhr schrieb Amos Jeffries <<a href="mailto:squid3@treenet.co.nz">squid3@treenet.co.nz</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 23/10/18 1:26 AM, Juan Carvajal B. wrote:<br>
> Dear list,<br>
> <br>
> I hope you can give me some hints for my current task.<br>
> <br>
> I would like to achieve the following:<br>
> <br>
> 1. A user comes with the own device, for example phone or table.<br>
> 2. The user connects to our own WLAN network<br>
> 4. The user enters the addres of our website<br>
> 3. The user can only access our website, which is hosted in a sever *not<br>
> connected* to the internet.<br>
> <br>
> We have the following set up<br>
> <br>
> Tablets / phones <---> WLAN router <---> server<br>
> <br>
> please note that there is *no* connection to internet. The server is<br>
> connected to the "internet" port of the router.<br>
> <br>
> The server runs ubuntu & apache.<br>
> <br>
> I've been trying to achieve this with squid but I get a **warning of a<br>
> forwarding loop**. I do not know what I'm doing wrong.<br>
> <br>
> I'm following this:<br>
> <a href="https://wiki.squid-cache.org/ConfigExamples/Intercept/LinuxRedirect" rel="noreferrer" target="_blank">https://wiki.squid-cache.org/ConfigExamples/Intercept/LinuxRedirect</a><br>
> <a href="https://wiki.squid-cache.org/SquidFaq/ReverseProxy" rel="noreferrer" target="_blank">https://wiki.squid-cache.org/SquidFaq/ReverseProxy</a><br>
> <br>
> Here are my conf files:<br>
> <br>
> ****squid.conf****<br>
> <br>
<br>
<br>
>     visible_hostname squid.proxy<br>
<br>
I have seen other people using this "squid.proxy" as the FQDN of their<br>
proxy. It is likely that your chosen proxy hostname is not unique.<br>
<br>
Since this is a reverse-proxy it is best to set this to the FQDN of the<br>
primary website you are proxying.<br>
<br>
<br>
<br>
>     http_port 3128 intercept<br>
>     http_port <a href="http://192.168.0.188:80" rel="noreferrer" target="_blank">192.168.0.188:80</a> accel<br>
> defaultsite=<a href="http://our.domain.org" rel="noreferrer" target="_blank">our.domain.org</a><br>
>     http_port <a href="http://192.168.0.188:443" rel="noreferrer" target="_blank">192.168.0.188:443</a> accel<br>
> defaultsite=<a href="http://our.domain.org" rel="noreferrer" target="_blank">our.domain.org</a><br>
<br>
The above should be https_port and requires the TLS certificate for the<br>
domain being virtual-hosted.<br>
<br>
see<br>
<<a href="https://wiki.squid-cache.org/ConfigExamples/Reverse/HttpsVirtualHosting" rel="noreferrer" target="_blank">https://wiki.squid-cache.org/ConfigExamples/Reverse/HttpsVirtualHosting</a>> which<br>
I added just yesterday.<br>
<br>
<br>
>     cache_peer 127.0.0.1 parent 80 0 no-query originserver name=myAccel<br>
>     acl our_sites dstdomain <a href="http://our.domain.org" rel="noreferrer" target="_blank">our.domain.org</a><br>
>     http_access allow our_sites<br>
>     cache_peer_access myAccel allow our_sites<br>
>     cache_peer_access myAccel deny all<br>
<br>
Move the above custom configuration down to ...<br>
<br>
>     acl SSL_ports port 443<br>
>     acl CONNECT method CONNECT<br>
>     http_access deny !Safe_ports<br>
<br>
You do not have any definition of Safe_ports above. It should contain at<br>
least 80 and 443 for your proxy.<br>
<br>
>     http_access deny CONNECT !SSL_ports<br>
>     http_access allow localhost manager<br>
>     http_access deny manager<br>
<br>
... here.<br>
<br>
<br>
You are missing good rules for traffic arriving on the port 3128. The<br>
below "allow all" is very bad.<br>
<br>
<br>
>     http_access allow localhost<br>
>     http_access allow all<br>
<br>
That should be:<br>
<br>
 http_access deny all<br>
<br>
<br>
...<br>
<br>
> ****IPTABLES****<br>
> <br>
>     # your proxy IP<br>
>     SQUIDIP=192.168.0.188<br>
>     # your proxy listening port<br>
>     SQUIDPORT=3128<br>
>     iptables -t nat -A PREROUTING -s $SQUIDIP -p tcp --dport 80 -j ACCEPT<br>
>     iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT<br>
> --to-port $SQUIDPORT<br>
> <br>
<br>
Here is your problem. You have not bypassed the traffic Squid is sending<br>
to <a href="http://127.0.0.1:80" rel="noreferrer" target="_blank">127.0.0.1:80</a>.<br>
<br>
Traffic to/from localhost does not use global IP addresses such as<br>
192.168.0.188. Thus Squid's attempts to send traffic to Apache is being<br>
looped back into port 3128 by iptables.<br>
<br>
<br>
What is the point of all this interception anyway?<br>
<br>
Your proxy is already listening on port 80 and 443 for directly<br>
receiving traffic to any domain with a DNS entry of 192.168.0.188.<br>
<br>
<br>
Amos<br>
_______________________________________________<br>
squid-users mailing list<br>
<a href="mailto:squid-users@lists.squid-cache.org" target="_blank">squid-users@lists.squid-cache.org</a><br>
<a href="http://lists.squid-cache.org/listinfo/squid-users" rel="noreferrer" target="_blank">http://lists.squid-cache.org/listinfo/squid-users</a><br>
</blockquote></div>