Linux Squid的反向 Proxy

來源:互聯網
上載者:User

一、基本原理

1、公網中的客戶機

client

200.168.10.2

2、squid反向 Proxy伺服器

eth0

200.168.10.2

eth1

192.168.10.1

3、內部web伺服器

web

192.168.10.2

二、修改squid.conf檔案

#配置虛擬80連接埠,防止資料報文直接丟失http_port 200.168.10.1:80 vhost#重新導向的web伺服器 0表示不使用上一級緩衝cache_peer 192.168.10.2 parent 80 0 originserver weight=5 max-conn=30#不能不寫visible_hostname 200.168.10.1#不限制訪問ipacl all src 0.0.0.0/0.0.0.0http_access allow all

如果開啟了squid緩衝池,此時可以看到動靜分離的效果了。

三、緩衝查看

1、通過 /var/log/httpd/access.log

2、通過 /var/spool/squid下的tree 00來查看檔案,然後如果有緩衝,則可以通過strings 00000000x來看

3、通過瀏覽器開發人員工具來看靜態檔案的載入狀態。

更多精彩內容:http://www.bianceng.cnhttp://www.bianceng.cn/Servers/proxy/

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.