nginx squid 雙機動靜分離問題
現有一台squid 伺服器 一台nginx
想實現動靜分離 圖片、css 、js 訪問squid
動態的請求訪問nginx 應該怎麼配置 給個思路
這樣配置出現了錯誤
192.168.118.128 為squid squid 的源 192.168.118.130
squid配置:
cache_peer 192.168.118.130 parent 80 0 no-query no-digest originserver name=a
cache_peer_domain a parent .spark.com www.spark.com
http_access allow all
cache_peer_access a allow all
192.168.118.130 為ngnix服務
www.spark.com 解析到192.168.118.130
配置
upstream php{
server 192.168.118.130 weight=4 max_fails=2 fail_timeout=30s;
}
upstream squid {
server 192.168.118.128:80 weight=1 max_fails=2 fail_timeout=30s;
}
server
{
listen 80;
server_name www.spark.com;
index index.html index.htm index.php;
root /data0/htdocs/www/bbs ;
#limit_conn crawler 20;
location /
{
proxy_pass http://php;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)$
# location /images/
{
proxy_pass http://squid;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
出現的問題是 當訪問 squid 會出現deny allow 錯誤。
[火星人
]
nginx squid 雙機動靜分離問題已經有446次圍觀
http://coctec.com/docs/service/show-post-18247.html