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

2013-10-05 19:00:22 +08:00
 zhttty
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 xxx@xxx.com
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的效果...
4070 次点击
所在节点    问与答
1 条回复
zhttty
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 解决。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/84634

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX