ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: archlinux, nginx и php-fastcgi...



Alexey Karagodov пишет:
ну нахрена здесь конфег пхп, да ещё с конфегаме? оч удобно ... :)))
Для более аккуратного выявления проблемы.

Сейчас прикрутил подобие твоего конфига, но оно не заработало, хотя ошибка уже изменилась. При обращении к /, возникает ошибка доступа - 403, в логах следующее:
-- access.log --
90.150.143.21 - - [08/Oct/2007:21:28:07 +0600] "GET / HTTP/1.1" 403 169 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.7) Gecko/20070918 BonEcho/2.0.0.7"
--

-- error.log --
2007/10/08 21:28:07 [error] 5468#0: *1 directory index of "/etc/nginx/html/" is forbidden, client: 90.150.143.21, server: eveel.kicks-ass.org, URL: "/", host: "eveel.kicks-ass.org:8080"
--

Внимание вопрос: что оно забыло в каталоге /etc/nginx/html, хотя в конфиге явно указано, что root /srv/www/nginx/spectrum?
Изменённый конфиг в аттаче.
fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;

fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;

fastcgi_param PATH_TRANSLATED     $_document_root$fastcgi_script_name;

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param  REDIRECT_STATUS    200;
user nginx;
worker_processes 2;

events {
    use epoll;
    worker_connections 1024;
}

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

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;

    keepalive_timeout  65;

    # mongrel proxy
    upstream mongrel {
        server 127.0.0.1:8000;
        server 127.0.0.1:8001;
    }

    # rails server
    server {
        listen 80;
        server_name eveel.kicks-ass.org;
        charset off;
       
        location / {
            root /srv/www/nginx/kopa.info;
            index index.html index.htm;
        }

        # serve the /files/ catalog as static
        location ~ /public/* {
            root /srv/www/nginx;
            autoindex on;
        }
   
        # / -> first search for local index.html then go to mongrel
        location ~ ^/$ {
            if (-f /index.html) {
                rewrite (.*) /index.html last;
            }
            proxy_pass http://mongrel;
        }
    
        # rails caching: searching first for $action.html local pages
        location / {
            if (!-f $request_filename.html) {
                proxy_pass http://mongrel;
            }
            rewrite (.*) $1.html last;
        }
    
        # serve static files directly
        location ~* 
^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|html|xhtml|js|mov)$
 {
            root /srv/www/nginx/kopa.info/public;
        }
    
        # resend everything else to mongrel
        location / {
            proxy_pass  http://mongrel;
            proxy_redirect off;
            proxy_set_header Host $http_host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
    }

    # php-fastcgi upstream
    upstream php {
        server unix:/tmp/php-fcgi.sock;
    }

    # php server
    server {
        listen 8080;
        server_name eveel.kicks-ass.org;
        charset off;

        # serve the /files/ catalog as static
        location ~ /public/* {
            root /srv/www/nginx;
            autoindex on;
        }

        set $_document_root /srv/www/nginx/spectrum;
        # redirect to php
        location ~ \.php$ {
                fastcgi_index index.php;
                include /etc/nginx/conf/fastcgi_params;
                root $_document_root;
                fastcgi_pass php;
        } 
    }
}


 




Copyright © Lexa Software, 1996-2009.