连续两天了,这个问题一直困扰着我,目前没有找到问题所在。(原文链接 http://ddbiz.com/?p=190)
系统结构:
192.168.0.1—/
192.168.0.2---> 组成内部网;
192.168.0.3--/
其中 192.168.0.2 运行nginx + fastcgi, 执行 php web服务
192.168.0.3 运行 iis, .net 2.x
192.168.0.2 同时绑定了 公网ip,
nginx 配置如下:
#
# file: conf/nginx.conf
#
user webuser webuser;
worker_processes 5;
pid /usr/local/webserver/nginx.pid;
events {
use epoll;
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" - "$http_cookie"';
access_log /usr/local/webserver/nginx/logs/access.log main;
error_log /usr/local/webserver/nginx/logs/error.log debug;
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
gzip on;
#large_client_header_buffers 10 8k;
include vhosts/*.conf;
server {
listen 80 default;
server_name _;
log_format defaultserver '$remote_addr - [$time_local] "$http_HEADER" "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for"'
'$upstream_http_addr "$upstream_http_$request" $upstream_status ' ;
access_log /usr/local/webserver/nginx/logs/access.log defaultserver;
error_log /usr/local/webserver/nginx/logs/error.log debug;
return 444;
}
}
#
#file: conf/vhosts/site1...x.conf
#site1..x.conf 定义了n个运行在php+httpd的站点,使用 php-cgi ,运行正常;此配置文件略
#
...
#
#file: conf/vhosts/siteiis1.conf
#
upstream devel
{
server 192.168.0.3:80;
}
proxy_cache_path /usr/local/webserver/cache/nginx/ levels=1:2 keys_zone=cache:10m inactive=10m max_size=1000M;
server {
listen 80;
server_name developer.mysite.com;
#index default.aspx;
log_format askac '$remote_addr - [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for"'
'$upstream_http_addr "$upstream_http_$request" $upstream_status ' ;
access_log /usr/local/webserver/nginx/logs/dev.access.log askac;
error_log /usr/local/webserver/nginx/logs/dev.error.log debug;
location / {
#proxy_redirect off;
##proxy_cache cache;
##proxy_cache_valid 200 304 24h;
##proxy_cache_key $host$request_uri$args;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#client_max_body_size 1m;
#client_body_buffer_size 128k;
#proxy_connect_timeout 90;
#proxy_send_timeout 90;
#proxy_read_timeout 90;
#proxy_buffer_size 8k;
#proxy_buffers 4 32k;
#proxy_busy_buffers_size 64k;
#proxy_temp_file_write_size 64k;
##expires 2d;
proxy_pass http://devel;
}
}
此配置完成后,所有的站点访问都很正常,包括 iis, php,稳定运行半年,今日忽然发现 iis 的站点无法访问,所有对iis的访问都会发生 Timeout,
日志文件显示如下:
#
#access.log
#
xxx.xxx.xx.xx - [02/Feb/2010:10:00:09 +0800] "-" "-" 400 0 "-" "-" "-"- "--" -
...
#
#error.log
#
2010/02/02 10:01:42 [info] 1321#0: *85 recv() failed (104: Connection reset by peer) while reading client request line, client: xxx.xxx.xx.xx, server: _
从上月30号发现此问题,到现在为止,工作没有任何进展。 :-(
经过最近的测试,最有可能的原因是机房问题,机房的黑名单吧特定的域名给过滤了。
还是问问机房吧。(原文链接 http://ddbiz.com/?p=190)