在用nginx做負載均衡時
在用nginx做負載均衡時
基本結構 NGinx(00) --->|--------|--------->nginx+php-fpm (01) (解析php)----------->|------->memcached------>mysql
| |--------->nginx+php-fpm(02) (解析php) ------------>|
|------------------> varnish (靜態文件)
現在是在沒有ngixn(00)前端的情況先 訪問nginx(01) (02)都正常,但是加了nginx(00)后,01 和02的頁面錯亂,基本為圖片和css文件 js文件全部丟失,而且訪問速度奇慢無比,高人指教!upstream backend {
server 192.168.1.3:8080;
server 192.168.1.4:8080;
}
include mime.types;
default_type application/octet-stream;
#charset gb2312;
charset UTF-8;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 20m;
limit_rate 1024k;
sendfile on;
tcp_nopush on;
keepalive_timeout 60;
tcp_nodelay on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;
gzip on;
#gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
#limit_zone crawler $binary_remote_addr 10m;
server
{
listen 80;
server_name www.newnew.com;
location / {
proxy_pass http://backend;
proxy_redirect off;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
}
location /Nginxstatus {
stub_status on;
access_log off;
}
[火星人
]
在用nginx做負載均衡時已經有372次圍觀
http://coctec.com/docs/service/show-post-5119.html