nginx + mongrel 配置文件

1 nginx 配置文件

user hchen;
worker_processes 2;
 
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
 
events {
  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"';
 
  access_log /var/log/nginx/access.log main;
 
  sendfile on;
 
  keepalive_timeout 65;
 
  upstream mongrel {
    server 127.0.0.1:8080;
    server 127.0.0.1:8081;
    server 127.0.0.1:8082;
  }
 
  server {
    listen 3000;
    server_name 192.168.11.120;
 
    root /home/hchen/www/test/public;
 
    location / {
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $http_host;
      proxy_redirect false;
 
      if (-f $request_filename/index.html) {
        rewrite (.*) $1/index.html break;
      }
      if (-f $request_filename.html) {
        rewrite (.*) $1.html break;
      }
      if (!-f $request_filename) {
        proxy_pass http://mongrel;
        break;
      }
    }
 
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
      root html;
    }
  }
} 

 2 mongrel_cluster.yml

 

--- 
user: mongrel
group: mongrel
cwd: /home/hchen/www/test
log_file: log/mongrel.log
port: "8080"
address: 127.0.0.1
environment: development
group: mongrel
pid_file: /tmp/mongrel.pid
servers: 3
 

你可能感兴趣的:(html,nginx,F#,Access)