FastCGI problem

Hello,

My nginx.conf is:
user web;
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 {
include /etc/nginx/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;

server {
    listen       80;
    server_name  80.80.150.21;
    if ($host ~* "([^\/]+)\.([^\.\/]+\.[^\.\/]+)" ) {
           set $prefix /$2/$1/root;
           rewrite (.*)    $prefix$1;

    }

    location / {
        root   /www;
        index  index.php index.html index.htm;
    }

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

    location ~ \.php$ {

fastcgi_pass 127.0.0.1:9000;

        fastcgi_pass   unix:/tmp/cgi.sock;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME

$document_root$prefix$fastcgi_script_name;
include /etc/nginx/fast-cgi;
}

}

}

This configuration is wrong. I don’t use valid SCRIPT_FILENAME. How to
change this options?

Please excuse my bad english…

С уважение,
Й. Георгиев.

WEB: http://gigavolt-bg.net/
Blog: http://live.gigavolt-bg.net/

use full path?
fastcgi_param SCRIPT_FILENAME /full/path$fastcgi_script_name;

2008/3/19, Yordan G. [email protected]:

Maybe something like:

fastcgi_param SCRIPT_FILENAME /www/$http_host/www/root
$fastcgi_script_name;

?

My full path is dynamic.

http://test.tld1/text.txt -> /www/test.tld1/www/root/text.txt
http://testa.tld1/text.txt -> /www/testa.tld1/www/root/text.txt
But i don’t use php. Result is: No input file specified.

On Wed, Mar 19, 2008 at 3:08 PM, bianbian [email protected]
wrote:

#access_log  logs/access.log  main;
    listen       80;
    }
        fastcgi_param  SCRIPT_FILENAME

Please excuse my bad english…

bianbian coding life:
http://bianbian.org


Please excuse my bad english…

С уважение,
Й. Георгиев.

WEB: http://gigavolt-bg.net/
Blog: http://live.gigavolt-bg.net/

http://slut.gigavolt-bg.net/ -> No input file specified.

user web;
worker_processes 1;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
#tcp_nopush on;

#keepalive_timeout  0;
keepalive_timeout  65;

#gzip  on;

server {
    listen       80;
    if ($host ~* "([^\/]+)\.([^\.\/]+\.[^\.\/]+)" ) {
           set $prefix /$2/$1/root;
           rewrite (.*)    $prefix$1;
    }
    location / {
            root /www;
            index index.php;
    }
    location ~ .php$ {
        root   /www;
        fastcgi_pass unix:/tmp/cgi.sock;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /www$fastcgi_script_name;
        fastcgi_param  QUERY_STRING     $query_string;
        fastcgi_param  REQUEST_METHOD   $request_method;
        fastcgi_param  CONTENT_TYPE     $content_type;
        fastcgi_param  CONTENT_LENGTH   $content_length;
    }
}

}

http://slut.gigavolt-bg.net/index.php -> ok
http://slut.gigavolt-bg.net/ -> http://slut.gigavolt-bg.net/

Please excuse my bad english…

С уважение,
Й. Георгиев.

WEB: http://gigavolt-bg.net/
Blog: http://live.gigavolt-bg.net/

Hello,

I create vhost rule for my nginx:

if ($host ~* “([^/]+).([^./]+.[^./]+)” ) {
set $root /www/$2/$1/root;
}
root $root;

BUT… I open domein.tld receive error 403. Howto rewrite domein.tld to
www.domein.tld with little resources?
My hostring tree is:
/www
/www/domein.tld
/www/domein.tld/sub1/root - for sub1.domein.tld
/www/domain.tld/www/root - for www.domein.tld and domein.tld

SOLVED:
if ($host ~* “([^./]+.[^./]+)” ) {
set $root /www/$1/www/root;
}
if ($host ~* “([^/]+).([^./]+.[^./]+)” ) {
set $root /www/$2/$1/root;
}

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs