configuring nginx for different rails apps under same domain

Archana Balaji lists at
Wed Nov 21 10:10:44 MSK 2007

i want to know how to  configure nginx for different rails app under the
same domain.
for example:
1)Rails application 1 <>
2)Rails application 2 <>

Below is my enginx configuration .i want to know where iam goin wrong
as i'm able to go in my home page but not able to navigate from login
and signup pages.


#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

pid        logs/;

events {
    worker_connections  1024;
    use epoll;

http {
    include       conf/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;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    gzip  on;
    gzip_http_version 1.0;
    gzip_comp_level 2;
    gzip_proxied any;
    gzip_types text/plain text/html text/css application/x-javascript
text/xml application/xml application/xml+rss text/javascript;

    server_names_hash_bucket_size 128; # this seems to be required for

        # mongrel cluster for
     upstream mongrel_cluster{
                server ;
                server ;
                server ;
                                 } server
    server {
        client_max_body_size 50M;
        root   /var/www/;
        #charset koi8-r;

        access_log  logs/access.log  main;
        rewrite_log on;

        location /app1/ {
                proxy_pass http://mongrel_cluster/;
                  proxy_redirect     off;

       location ~
^/(images|javascripts|js|css|stylesheets|tiles|static|demo)/          {
            root /var/www/;

            expires 30d;

        location ~*
                  root /var/www/;
                  expires 30d;

        location / {
            proxy_pass  http://mongrel_cluster;
            proxy_redirect     off;
            proxy_set_header   Host             $host;
            proxy_set_header   X-Real-IP        $remote_addr;

        error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        location ~ /\.ht {
            deny  all;
Posted via

More information about the nginx mailing list