如何在鱿鱼3中实现临时页面?

我正在尝试为所有客户端请求实现一个临时的公告页面,这意味着此页面将在几秒钟后消失,并且URL将回到原始客户端请求。 我也尝试perl下面的url_rewrite_program和deny_info(&allow localhost)acl,但都失败了。 有没有人有这个更好的主意? 我真的需要你的帮助。 谢谢!

#!/usr/bin/perl use strict; use warnings; my @X; my $url=""; $| = 1; while (<>) { @X = split; $url = $X[0]; print "302:http://announcement.txt\n"; sleep 5; print "$url\n"; } 

你有鱿鱼,所以忘了尝试自己编写代码,并使用鱿鱼的内置的启动页面function。

这个来自squid页面的3.2+示例将每小时显示启动页面/etc/squid/splash.html一次(请参阅该页面以获取更多示例和完整说明,包括3.2之前的squid示例):

 # mind the wrap. this is one line: external_acl_type splash_page ttl=60 concurrency=100 %SRC /usr/local/sbin/squid/ext_session_acl -t 7200 -b /var/lib/squid/session.db acl existing_users external splash_page http_access deny !existing_users # Deny page to display deny_info 511:/etc/squid/splash.html existing_users