V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
zhttty
V2EX  ›  问与答

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

  •  
  •   zhttty · 2013-10-05 19:00:22 +08:00 · 4034 次点击
    这是一个创建于 4070 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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 条回复    1970-01-01 08:00:00 +08:00
    zhttty
        1
    zhttty  
    OP
       2013-10-05 19:39:25 +08:00
    问完问题,转了一圈回来,再仔细翻了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 解决。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   4217 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 10:16 · PVG 18:16 · LAX 02:16 · JFK 05:16
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.