Nginx Rails + Php

Arthur Chan lists at ruby-forum.com
Thu Feb 11 04:23:02 MSK 2010


Hi Guys,

How can I make a config to set up both Rails and PHP, diff request will
go to diff server, what's wrong with the following, can I setup
RailsWThin and Php as below:



upstream thin_cluster {
      server
unix:/usr/local/src/railsapp/app/current/tmp/sockets/thin.0.sock;
      server
unix:/usr/local/src/railsapp/app/current/tmp/sockets/thin.1.sock;
   server
unix:/usr/local/src/railsapp/app/current/tmp/sockets/thin.2.sock;
  server
unix:/usr/local/src/railsapp/app/current/tmp/sockets/thin.3.sock;
  server
unix:/usr/local/src/railsapp/app/current/tmp/sockets/thin.4.sock;

    }

  server {
    server_name alpha.domain.com;
    location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
        fastcgi_pass  127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param  SCRIPT_FILENAME
/var/www/nginx-default$fastcgi_script_name;
    }

  }
  server {
    listen 1937;
    server_name beta.domain.com;

    root /user/local/src/railsapp/app/shared/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) {
        proxy_pass http://thin_cluster;
        break;
      }
    }



  }
-- 
Posted via http://www.ruby-forum.com/.



More information about the nginx mailing list