Ruby p290p; nginx 1.0.;8 unicorn url redirect


Sorry to bother you, I find this odd problem. When using ruby p180 +
nginx 1.0.8 + unicorn, the url redirection works perfectly but with ruby
p290, the page always redirects to the first entry on our vhost file.
Any inputs will be greatly appreciated. Thanks Guys!

Here is my entry on my vhost.conf:

server {
listen 80;
rewrite ^(.*) permanent;

my nginx.conf:

user www-data;
worker_processes 2;
worker_rlimit_nofile 30000;
daemon off;

error_log /mnt/log/nginx/error.log;
pid /var/run/;

events {
worker_connections 2048;

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

access_log /mnt/log/nginx/access.log;

sendfile on;
tcp_nopush on;
tcp_nodelay on;

keepalive_timeout 65;

gzip on;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/css application/json
application/x-javascript text/xml application/xml application/xml+rss
gzip_vary on;
gzip_buffers 16 8k;
gzip_disable “MSIE [1-6].(?!.*SV1)”;

server_names_hash_bucket_size 64;

include /etc/nginx/conf.d/*.conf;

my unicorn.conf:

include /etc/nginx/conf.d/unicorn/upstream.conf;

HTTP server

server {
listen 80;
server_name ip-10-138-105-254;
log_format aws ‘$proxy_add_x_forwarded_for - $remote_user
[$time_local] “$request” $status $body_bytes_sent “$http_referer”
access_log /mnt/log/nginx/ip-10-138-105-254.access.log aws;
root /var/www/friendster-neutron/current/public;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

include /etc/nginx/conf.d/unicorn/server.conf;

client_max_body_size 100m;
error_page 413 /413.html;

recursive_error_pages on;

if ($request_filename ~ “version.txt”) {

if ($request_filename ~ “/status/check”) {

if (-f $document_root/system/maintenance) {
return 503;

rewrite asset urls to remove the SHA

rewrite “^/[0-9a-f]{40}/(.*)” /$1 last;

error_page 503 @503;
location @503 {
error_page 405 = /maintenance.html;

if (-f $request_filename) {

rewrite ^(.*)$ /maintenance.html break;


location ~ ^/(images|javascripts|assets|stylesheets)/ {
add_header Cache-Control public;
expires modified +720h;

location ~ .(html|ico)$ {
add_header Cache-Control public;
expires modified +720h;

my unicorn/server.conf

try_files $uri @app;

location @app {

proxy_pass http://app_server;



upstream app_server {
server unix:/tmp/unicorn.sock fail_timeout=0;

Posted at Nginx Forum:

taken out ruby and rvm system wide and unicorn config on the nginx but
nginx still redirects.

Posted at Nginx Forum:

another update: using server_name localhost; or private ipaddress, it
always redirect but using public hostname the nginx is functioning well.
Anyway how to bypass this one? thanks

Posted at Nginx Forum: