歡迎您光臨本站 註冊首頁

【FAQ】如何使 squid 使用本地時區

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

【FAQ】如何使 squid 使用本地時區


http://www.squid-cache.org/Doc/FAQ/FAQ-10.html#ss10.25

Squid by defaults uses GMT as timestamp in all generated error messages. This to allow the cache to participate in a hierarchy of caches in different timezones without risking confusion about what the time is.

To change the timestamp in Squid generated error messages you must change the Squid signature. See Customizable Error Messages. The signature by defaults uses %T as timestamp, but if you like then you can use %t instead for a timestamp using local time zone.

http://www.squid-cache.org/Doc/FAQ/FAQ-19.html#custom-err-msgs

Squid-2 lets you customize your error messages. The source distribution includes error messages in different languages. You can select the language with the configure option:

        --enable-err-language=lang

Furthermore, you can rewrite the error message template files if you like. This list describes the tags which Squid will insert into the messages:

%B

    URL with FTP %2f hack
%c

    Squid error code
%d

    seconds elapsed since request received (not yet implemented)
%e

    errno
%E

    strerror()
%f

    FTP request line
%F

    FTP reply line
%g

    FTP server message
%h

    cache hostname
%H

    server host name
%i

    client IP address
%I

    server IP address
%L

    contents of err_html_text config option
%M

    Request Method
%m

    Error message returned by external auth helper
%p

    URL port \#
%P

    Protocol
%R

    Full HTTP Request
%S

    squid default signature
%s

    caching proxy software with version
%t

    local time
%T

    UTC
%U

    URL without password
%u

    URL with password (Squid-2.5 and later only)
%w

    cachemgr email address
%z

    dns server error message

The Squid default signature is added automatically unless %s is used in the error page. To change the signature you must manually append the signature to each error page.

The default signature reads like:

    <BR clear="all">
    <HR noshade size="1px">
    <ADDRESS>
    Generated %T by %h (%s)
    </ADDRESS>
    </BODY></HTML>



[ 本帖最後由 platinum 於 2006-4-23 09:51 編輯 ]
《解決方案》

用squidclient抓的呢

HTTP/1.0 200 OK
Server: squid/2.6.STABLE13
Date: Tue, 05 May 2009 06:43:36 GMT
Content-Type: text/plain
Expires: Tue, 05 May 2009 06:43:36 GMT
Last-Modified: Tue, 05 May 2009 06:43:36 GMT
X-Cache: MISS from 10.8.0.1
X-Cache-Lookup: MISS from 10.8.0.1:3318
Via: 10.8.0.1:3318 (squid/2.6.STABLE13)
Proxy-Connection: close

Squid Object Cache: Version 2.6.STABLE13
Start Time:     Tue, 05 May 2009 06:21:10 GMT
Current Time:   Tue, 05 May 2009 06:43:36 GMT
Connection information for squid:
        Number of clients accessing cache:      96

這個裡面的GMT如何改成CST?

[火星人 ] 【FAQ】如何使 squid 使用本地時區已經有597次圍觀

http://coctec.com/docs/service/show-post-22879.html