CentOS6.5使用Nginx+Passenger部署Ruby on Rails环境(2)

Nginx主配置文件/data/app_platform/nginx/conf/nginx.conf
user  www;
worker_processes  4;
 
error_log  /data/app_data/nginx/logs/error.log  error;
 
pid        /data/app_data/nginx/logs/nginx.pid;
 
worker_rlimit_nofile 65535;
 
events {
    use epoll;
    worker_connections  10240;
}
 
 
http {
    passenger_root /data/app_platform/passenger;
    passenger_ruby /usr/bin/ruby;
    passenger_max_pool_size 10;
    passenger_debug_log_file /data/app_data/nginx/logs/passenger.log;
    passenger_show_version_in_header on;
    passenger_spawn_method smart;
   
    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  logs/access.log  main;
 
    sendfile        on;
    tcp_nopush      on;
    tcp_nodelay    on;
    server_tokens off; 
 
    keepalive_timeout  60;
    server_names_hash_bucket_size 128;
    client_header_buffer_size 32k;
    large_client_header_buffers 1 128k;# 4 32k
    client_max_body_size 8m;
    client_body_buffer_size 128k;
 
    fastcgi_connect_timeout 60;
    fastcgi_send_timeout 60;
    fastcgi_read_timeout 60;
    fastcgi_buffer_size 256k;
    fastcgi_buffers 4 512k;#8 128
    fastcgi_busy_buffers_size 512k;
    fastcgi_temp_file_write_size 512k;
    #fastcgi_intercept_errors on;
 
    gzip on;
    gzip_min_length 1k;
    gzip_buffers    1 64k; #4 16
    gzip_http_version 1.0;
    gzip_comp_level 2;
    gzip_types      text/plain application/x-javascript text/css application/xml;
    gzip_vary on;
   
 
    include /data/app_platform/nginx/conf/conf.d/*.conf;
     
 
    server {
 
          listen      80        default;
          server_name _;
          return 403;
 
 
            }
}

Nginx主配置文件关键部分就是这里,表明passenger是整合到Nginx中的。
    passenger_root /data/app_platform/passenger;
    passenger_ruby /usr/bin/ruby;
    passenger_max_pool_size 10;
    passenger_debug_log_file /data/app_data/nginx/logs/passenger.log;
    passenger_show_version_in_header on;
    passenger_spawn_method smart;

添加虚拟主机

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/2722c13014529e6f1ecf281f5f695b95.html