[squid-users] Re: Any way to redirect pages on return code?
Platoali wrote: Hi, I'm looking for a way to make squid to redirect my users to a specific page when a special return code have been encountered. for example, here a part of my access log: 1242562024.085347 172.20.0.68 TCP_MISS/403 1082 GET http://www.b.com - DIRECT/195.189.143.133 - I want squid see that the server is returning 403 code. just redirect it to my specific page. Does anyone know how can this be done? I've found this, but does not work at all: acl filtering http_status 403 http_access deny filtering deny_info /var/www/L4.html filtering but it does not redirect to my page and I see these my cache.log. Any suggestion: 2009/05/18 11:56:25| ACL::checklistMatches WARNING: 'filtering' ACL is used but there is no HTTP reply -- not matching. 2009/05/18 11:56:26| ACL::checklistMatches WARNING: 'filtering' ACL is used but there is no HTTP reply -- not matching. 2009/05/18 11:56:27| ACL::checklistMatches WARNING: 'filtering' ACL is used but there is no HTTP reply -- not matching. But I see that clearly in the access log that 403 is returned from web server. Best regards Platoali
Re: [squid-users] Re: Any way to redirect pages on return code?
On Do shanbe 28 Ordibehesht 1388 13:15:22 Amos Jeffries wrote: Platoali wrote: Platoali wrote: Hi, I'm looking for a way to make squid to redirect my users to a specific page when a special return code have been encountered. for example, here a part of my access log: 1242562024.085347 172.20.0.68 TCP_MISS/403 1082 GET http://www.b.com - DIRECT/195.189.143.133 - I want squid see that the server is returning 403 code. just redirect it to my specific page. Does anyone know how can this be done? I've found this, but does not work at all: acl filtering http_status 403 http_access deny filtering deny_info /var/www/L4.html filtering but it does not redirect to my page and I see these my cache.log. Any suggestion: 2009/05/18 11:56:25| ACL::checklistMatches WARNING: 'filtering' ACL is used but there is no HTTP reply -- not matching. 2009/05/18 11:56:26| ACL::checklistMatches WARNING: 'filtering' ACL is used but there is no HTTP reply -- not matching. 2009/05/18 11:56:27| ACL::checklistMatches WARNING: 'filtering' ACL is used but there is no HTTP reply -- not matching. But I see that clearly in the access log that 403 is returned from web server. Best regards Platoali Try using it in http_reply_access where the _reply_ status is present. Thank you very much. It works very well that way. Amos
[squid-users] Any way to redirect pages on return code?
Hi, I'm looking for a way to make squid to redirect my users to a specific page when a special return code have been encountered. for example, here a part of my access log: 1242562024.085347 172.20.0.68 TCP_MISS/403 1082 GET http://www.b.com - DIRECT/195.189.143.133 - I want squid see that the server is returning 403 code. just redirect it to my specific page. Does anyone know how can this be done? Best Regards Ali Yazdi
[squid-users] squid -k rotate does not work
Hi, I've a problem with squid log rotatation. here is the content of my /var/log/squid: # ls -l total 16940 -rw-r- 1 proxy proxy 661760 Sep 30 10:26 access.log -rw-r- 1 proxy proxy 8104 Sep 30 10:26 cache.log -rw-r- 1 proxy proxy 13429584 Sep 30 10:26 cache0 -rw-r- 1 proxy proxy 1468800 Sep 30 10:26 cache1 -rw-r- 1 proxy proxy 790704 Sep 30 10:22 cache2 -rw-r- 1 proxy proxy 246672 Sep 30 10:22 cache3 -rw-r- 1 proxy proxy 687345 Sep 30 10:26 store.log when I issue the command: #squid -k rotate and then list the directory: # ls -l total 17192 -rw-r- 1 proxy proxy 776750 Sep 30 10:27 access.log -rw-r- 1 proxy proxy 8680 Sep 30 10:27 cache.log -rw-r- 1 proxy proxy 13432272 Sep 30 10:27 cache0 -rw-r- 1 proxy proxy0 Sep 30 10:27 cache0.last-clean -rw-r- 1 proxy proxy 1468704 Sep 30 10:27 cache1 -rw-r- 1 proxy proxy0 Sep 30 10:27 cache1.last-clean -rw-r- 1 proxy proxy 790704 Sep 30 10:27 cache2 -rw-r- 1 proxy proxy0 Sep 30 10:27 cache2.last-clean -rw-r- 1 proxy proxy 246672 Sep 30 10:27 cache3 -rw-r- 1 proxy proxy0 Sep 30 10:27 cache3.last-clean -rw-r- 1 proxy proxy 822761 Sep 30 10:27 store.log The access.log and and cache.log didn't rotate. The is nothing in the cache.log: 2008/09/30 10:27:02| storeDirWriteCleanLogs: Starting... 2008/09/30 10:27:02| 65536 entries written so far. 2008/09/30 10:27:02|131072 entries written so far. 2008/09/30 10:27:02|196608 entries written so far. 2008/09/30 10:27:02|262144 entries written so far. 2008/09/30 10:27:02|327680 entries written so far. 2008/09/30 10:27:02| Finished. Wrote 332030 entries. 2008/09/30 10:27:02| Took 0.1 seconds (3188457.3 entries/sec). 2008/09/30 10:27:02| logfileRotate: /var/log/squid/store.log 2008/09/30 10:27:02| logfileRotate: /var/log/squid/access.log here is the permissions for squid directory: # ls -l | grep squid drwxr-xr-x 2 proxy proxy4096 Sep 30 10:27 squid does any one have any clue? Best regards Platoali
Re: [squid-users] squid -k rotate does not work
Michael Alger wrote: Do you have logfile_rotate set in your squid.conf? If this is 0, then squid won't actually rotate the logfile, but instead just close and re-open it. This is the default on Debian (and maybe other distros), as it uses logrotate to actually rotate the logs. Thank you very much, logfile_rotate was not set. But it seems that that is the default behavior of squid. My problem was a bad configuration in logrotate daemon. You clue was very helpfull. Thank you very much. Best regards Platoali