Squid not listening on port 80
-
The previous version 2.1 is impossible to change too BUT the old squid package doesn't care for it.
pfsense, not squid…
-
While fixing the package to 2.2, it was working.
Use old workaround instead until we find a way to fix it again.
Listen squid on a high port and nat it from 80/443 to configured port.
If you preffer, you can (re)open a redmine ticket for it.
-
Thats the workaround I had in mind ;D
Many thanks for your help
-
I've officially upgraded my box to 2.2 today and if you use a higher port with a nat redirect; it works with not issues from what I can tell.
-
Cino,
Can you elaborate about how to configure the NAT redirect as a work around?
I am configuring a reverse proxy to use with Lync and need to use port 443.
Thanks,
Rody.
-
Have squid reverse proxy listen to lets say port 8443, using loopback for its interface. Then create a WAN NAT to redirect all incoming traffic from port 443 to 8443.
e.g here is my NAT for port 80
WAN TCP * * WAN address 80 (HTTP) 127.0.0.1 9080 HTTP squid-reverse redirect
squid is setup for loopback listen on port 9080
-
Have squid reverse proxy listen to lets say port 8443, using loopback for its interface.
Until we find a another way to workaround non root users listening on low ports security rule.
-
Thanks Cino,
I created the WAN NAT to redirect incoming traffic from port 443 to the port 1443:
WAN TCP * * WAN address 443 (HTTPS) 127.0.0.1 1443
Then have Squid Reverse Proxy listen on 1443 on "reverse HTTPS port" under "Squid Reverse HTTPS Settings" but that does not work.
I don't get the part where you said "squid is setup for loopback listen on port 9080" Is this port 9080 something that I have to configure some place else for the loopback address? Then change 1443 for 9080?
I don't think this is a default port, so where in Squid Reverse Proxy is this lookback port configured?
Thanks,
Rody.
-
@rody:
Then have Squid Reverse Proxy listen on 1443 on "reverse HTTPS port" under "Squid Reverse HTTPS Settings" but that does not work.
Did you also change the 'Reverse Proxy interface' from WAN to LAN? That took me a while to find out.
-
'Reverse Proxy interface' - select loopback as the interface… use a higher port like 8443 or 9443 for 'reverse HTTPS port'
-
'Reverse Proxy interface' - select loopback as the interface… use a higher port like 8443 or 9443 for 'reverse HTTPS port'
In stead of using loopback I first set up the NAT to redirect WAN 443 to port 8443 on the LAN-IP of pfSense and had Squid listen to the LAN interface. This works fine.
Now I changed the NAT to redirect to 127.0.0.1 and have Squid listen to loopback. This also work fine.
Is there a reason to prefer one method over the other?
-
Is there a reason to prefer one method over the other?
If you do not need to listen on lan, listen on a interface that nobody has direct access to.
-
Gah! I just got hit with this one. I just got my authetication issues figured out and decided to tighten up my proxy setup. So, the first and only thing I did was try to set my proxy to a port lower than 1024.
Checking the logs, it appears the squid process isn't able to open ports below 1024 since they are reserved ports…only root can.
But, Squid 2 is able to open ports below 1024 without any issues. Squid3 isnt.
Has there been much movement on allowing squid to open ports below 1024? I have tried adjusting the sysctl parameters with no luck.
-
Actually,
I was able to get the kernel to allow non-root users to open ports below 1024 by tweaking this kernel parameter:net.inet.ip.portrange.reservedhigh=20
I just added that line to my /etc/sysctl.conf file. Be sure to adjust the port to whatever you like. I did 15 just for testing, and put squid on port 30.
Once you edit that file, you will need to reload the parameters by doing asysctl -a
from the command line.
Or, you can actually do this from the systems tuneables menu on the web page.
Goto System > Advanced then click on the "System Tuneables" tab.
Scroll to the bottom, and click the little "+" icon to add a new tuneable rule.
For the Tuneable field use:net.inet.ip.portrange.reservedhigh
And for the value field, put what ever the lowest port you want to allow normal users to open. I did 15 in my example. Then hit save.
Here is what it looks like:
http://i.imgur.com/5XXNsI1.pngWhile this isn't a good thing to do for security, I have honestly felt that the reserved ports in Linux is a dinosaur. This is a good workaround.
-
I'll include this information on squid gui alert.
Thanks for your feedback. -
Hi, I had this problem too and while waiting for a FIX I had to configure a NAT on the loopback interface for each WAN connection.
It works but it's not very nice.
Waiting for a patch ;D
-
HI @ll,
I had the same issue after upgrading to 2.2 and managed to fix my reverse proxy by listening on loopback and natting port 80 to 10080. So far so good.
Any cname record is redirected as desired (mail.mydomain.com, ftp.mydomain.com etc.) but NOT the common www.mydomain.com - even though I generated several redirection regex entries like ^http://www.mydomain.com/.*$.
It looks like it could not resolve this redirection and therefore want to stay on the pfsense, turning http to https in the browser's web address field and ending up with timeout error (site not available). This behaviour occurs only when trying to reach www.mydomain.com from the WAN.
Any hints from you guys?
Thanks and regards
Dave -
I have similar problem, https://forum.pfsense.org/index.php?topic=90885.0
-
Issue solved - somehow!
I use a captive portal which maintains a local web server on the pfsense. When I disable the captive portal, a call for www.mydomain.com is redirect over the reverse proxy to the right destination as required
After upgrade from 2.1 to 2.2 it seems to have mixed something up in the captive portal settings. Have not yet figured out details, but it looks like such local webserver was in priority before going into NAT for 80 to 10080. Does not explain why it turned a port 80 call into 443 (and why problem did not exist on requests from LAN), but that is something I have to examine next.
Best regards
Dave -
Happy Easter Sunday Guys!
It would even happier if I could make the Squid work. Upgraded to v2.2.1 yesterday and went through this post top to bottom but still can make it work. What I want to do is access the ip-camera, which is running on 10.0.11.21:8081 using the URL: lhdome.mydomain.co.uk/01
As suggested, configured a NAT to redirect traffic for port 80 to 8080 on loopback address and set Squid to listen on loopback address. This is what my settings are now:Reverse Proxy server: General
Reverse Proxy server: Peers
Reverse Proxy server: Mappings: Edit
Firewall: NAT: Port Forward
I get 404 - Not Found in return. Any one out here can tell me what I'm doing wrong or missing please? Best!