# Rails on nginx/passenger/xubuntu error

**URL:** <https://www.ruby-forum.com/t/rails-on-nginx-passenger-xubuntu-error/187160>\
**Category:** Rails\
**Created:** [April 18, 2010, 9:46pm UTC](https://www.ruby-forum.com/t/rails-on-nginx-passenger-xubuntu-error/187160 "2010-04-18T21:46:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![badnaam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e36b37/32.png) [@badnaam](https://www.ruby-forum.com/u/badnaam)\
**Post date:** [April 18, 2010, 9:46pm UTC](https://www.ruby-forum.com/t/rails-on-nginx-passenger-xubuntu-error/187160/1 "2010-04-18T21:46:20Z")

</div>

I just installed latest rails, passenger, nginx on xubuntu.

I deployed a static app (myapp) on port 80 and it seems to work fine.  
I installed fast-cgi and deployed phpmyadmin on 8888 which works fine.  
Then I tried to deploy a rails app (test) to port 8484, and it didn’t  
work. I simply copied my rails apps files to /var/www/test/current  
directory for the deployment. Since 8484 didn’t work, I changed the  
port of the rails app to 80 (previously held by static myapp) and  
switched myapp to 8484. Now when I hit [http://localhost](http://localhost) it keeps  
taking me to the index.html page of myapp, no sign of the rails app.

here is my nginx.conf files, not sure if this is a passenger issue or  
nginx problem.

The rails app (simple hello world), works just fine in dev.

#user nobody;  
worker\_processes 1;

#error\_log logs/error.log;  
#error\_log logs/error.log notice;  
#error\_log logs/error.log info;

#pid logs/nginx.pid;

events {  
worker\_connections 1024;

}

http {  
passenger\_root /usr/lib/ruby/gems/1.8/gems/passenger-2.2.11;  
passenger\_ruby /usr/bin/ruby1.8;

```
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;

#keepalive_timeout 0;
keepalive_timeout 65;

#gzip on;

```

#for test  
server {  
listen 80;  
server\_name localhost;

```
    #charset koi8-r;

    access_log logs/test.access.log;
    error_log logs/test.error.log;

    #location / {
        rails_env development;
        root /var/www/test/current/public;
        passenger_enabled on;
        #index index.html index.htm;
    #}

    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 /;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    # proxy_pass http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on

```

127.0.0.1:9000  
#  
#location ~ .php$ {  
# root html;  
# fastcgi\_pass 127.0.0.1:9000;  
# fastcgi\_index index.php;  
# fastcgi\_param SCRIPT\_FILENAME /scripts  
$fastcgi\_script\_name;  
# include fastcgi\_params;  
#}

```
    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    # deny all;
    #}
}
    server {
    listen 8888;
    server_name localhost;
    access_log logs/phpmyadmin.access_log;
    error_log logs/phpmyadmin.error_log;

    location / {
    root /usr/share/phpmyadmin;
    index index.php;
    }

    location ~ \.php$ {
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME /usr/share/phpmyadmin

```

$fastcgi\_script\_name;  
include /etc/nginx/fastcgi.conf;  
}  
}

```
server {
    listen 8484;
    server_name localhost;

    #charset koi8-r;

    access_log logs/testrails.access.log;
    error_log logs/testrails.error.log;

    passenger_enabled on;
    location / {
        root /var/www/myapp/current/public;
        index index.html index.htm;
    }

    #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;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    # proxy_pass http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on

```

127.0.0.1:9000  
#  
#location ~ .php$ {  
# root html;  
# fastcgi\_pass 127.0.0.1:9000;  
# fastcgi\_index index.php;  
# fastcgi\_param SCRIPT\_FILENAME /scripts  
$fastcgi\_script\_name;  
# include fastcgi\_params;  
#}

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

# another virtual host using mix of IP-, name-, and port-based

```

configuration  
#  
#Server {  
# listen 8000;  
# listen somename:8080;  
# server\_name somename alias another.alias;

```
# location / {
# root html;
# index index.html index.htm;
# }
#}

# HTTPS server
#
#server {
# listen 443;
# server_name localhost;

# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;

# ssl_session_timeout 5m;

# ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:

```

+SSLv2:+EXP;  
# ssl\_prefer\_server\_ciphers on;

```
# location / {
# root html;
# index index.html index.htm;
# }
#}

```

}
