zhttty
V2EX  ›  问与答

squid做反向代理,网站无法login和post,如何解决?

  •  
  •   zhttty · Oct 5, 2013 · 4565 views
    This topic created in 4627 days ago, the information mentioned may be changed or developed.
    squid的配置如下,该配置可以浏览被反代的网站,但就是无法login、post和upload...

    squid.conf:
    http_port 80 transparent
    cache_mem 64 MB
    cache_dir ufs /var/spool/squid 4096 16 256
    cache_effective_user squid
    cache_effective_group squid
    access_log /var/log/squid/access.log
    cache_log /var/log/squid/cache.log
    cache_store_log /var/log/squid/store.log
    visible_hostname xxx
    cache_mgr [email protected]
    acl all src 0.0.0.0/0.0.0.0
    http_access allow all
    cache_peer 162.243.xxx.xxx parent 80 0 no-query originserver name=web
    cache_peer_domain web blog.xxx.com
    cache_peer_access web allow all

    题外话:我是想实现类似于cdn以及隐藏真实ip的效果...
    1 replies    1970-01-01 08:00:00 +08:00
    zhttty
        1
    zhttty  
    OP
       Oct 5, 2013
    问完问题,转了一圈回来,再仔细翻了squid.conf里边的注释,发现了
    # TAG: nonhierarchical_direct
    # By default, Squid will send any non-hierarchical requests
    # (matching hierarchy_stoplist or not cacheable request type) direct
    # to origin servers.
    #
    # If you set this to off, Squid will prefer to send these
    # requests to parents.
    #
    # Note that in most configurations, by turning this off you will only
    # add latency to these request without any improvement in global hit
    # ratio.
    #
    # If you are inside an firewall see never_direct instead of
    # this directive.

    加了一句:nonhierarchical_direct off 解决。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3244 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 00:17 · PVG 08:17 · LAX 17:17 · JFK 20:17
    ♥ Do have faith in what you're doing.