Forum: NGINX index.php dont run!

Posted by nackgr (Guest)
on 2012-11-20 12:50
(Received via mailing list)
Hello

I use Centos 6.3 with nginx  and php-FPM and FastCGI

I have a website dafuq.gr

when i write dafuq.gr dont open gives error
with dafuq.gr/index.php  opens !


Any idea ?

i checked at
/etc/nginx/sites-available
the vhost file

it looks like

server {
        listen *:80;


        server_name dafuq.gr www.dafuq.gr;

        root   /var/www/dafuq.gr/web;

        index index.php ;



        error_page 400 /error/400.html;
        error_page 401 /error/401.html;
        error_page 403 /error/403.html;
        error_page 404 /error/404.html;
        error_page 405 /error/405.html;
        error_page 500 /error/500.html;
        error_page 502 /error/502.html;
        error_page 503 /error/503.html;
        recursive_error_pages on;
        location = /error/400.html {
            internal;
        }
        location = /error/401.html {
            internal;
        }
        location = /error/403.html {
            internal;
        }
        location = /error/404.html {
            internal;
        }
        location = /error/405.html {
            internal;
        }
        location = /error/500.html {
            internal;
        }
        location = /error/502.html {
            internal;
        }
        location = /error/503.html {
            internal;
        }

        error_log /var/log/ispconfig/httpd/dafuq.gr/error.log;
        access_log /var/log/ispconfig/httpd/dafuq.gr/access.log 
combined;

        ## Disable .htaccess and other hidden files
        location ~ /\. {
            deny all;
            access_log off;
            log_not_found off;
        }

        location = /favicon.ico {
            log_not_found off;
            access_log off;
        }

        location = /robots.txt {
            allow all;
            log_not_found off;
            access_log off;
        }

        location /stats {
            index index.html index.php;
            auth_basic "Members Only";
            auth_basic_user_file
/var/www/clients/client1/web1/.htpasswd_stats;
        }

        location ^~ /awstats-icon {
            alias /usr/share/awstats/icon;
        }

        location ~ \.php$ {
            try_files $uri =404;
      include /etc/nginx/fastcgi_params;
            fastcgi_pass 127.0.0.1:9010;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
            fastcgi_param PATH_INFO $fastcgi_script_name;
            fastcgi_intercept_errors on;
        }

        location /cgi-bin/ {
            try_files $uri =404;
            include /etc/nginx/fastcgi_params;
            root /var/www/clients/client1/web1;
            gzip off;
            fastcgi_pass  unix:/var/run/fcgiwrap.socket;
            fastcgi_index index.cgi;
            fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
            fastcgi_intercept_errors on;
        }

        rewrite ^/rss /rss.php last;
        rewrite ^/submit_video /index.php?task=submit&type=videos last;
        rewrite ^/submit_image /index.php?task=submit&type=images last;
        rewrite ^/error /index.php?task=error last;
        rewrite ^/page-([0-9]+) /index.php?page=$1 last;
        rewrite ^/page/([0-9]+) /index.php?task=view_page&id=$1 last;
        rewrite ^/page/([^/.]+) /index.php?task=view_page&name=$1 last;
        rewrite ^/top-views /index.php?task=top-views last;
        rewrite ^/top-rated /index.php?task=top-rated last;
        rewrite ^/category/([a-zA-Z0-9-]+)/page/([0-9]+)
/index.php?task=category&category=$1&page=$2 last;
        rewrite ^/category/([a-zA-Z0-9-]+)
/index.php?task=category&category=$1 last;
        rewrite ^/connect/([a-zA-Z0-9-]+) 
/index.php?task=connect&type=$1
last;
        rewrite ^/login /index.php?task=login last;
        rewrite ^/callback/([a-zA-Z0-9-]+) 
/index.php?task=callback&type=$1
last;
        rewrite ^/logout /index.php?task=logout last;
        rewrite ^/user/([a-zA-Z0-9_-]+)/([a-zA-Z0-9-]+)
/index.php?task=user&action=$1&code=$2 last;
        rewrite ^/user/([a-zA-Z0-9-]+) /index.php?task=user&action=$1 
last;
        rewrite ^/user /index.php?task=user last;
        rewrite ^/search/([a-zA-Z0-9-]+)/page/([0-9]+)
/index.php?task=search&s=$1&page=$2 last;
        rewrite ^/search/([a-zA-Z0-9-]+) 
/index.php?task=search&s=$1&page=1
last;
        rewrite ^/search /index.php?task=search last;
        rewrite ^/view/([0-9]+) /index.php?task=view&id=$1 last;
        rewrite ^/view/([0-9]+).([^/.]+) /index.php?task=view&id=$1 
last;
        if (!-f $request_filename){
        set $rule_23 1$rule_23;
        }
        if (!-d $request_filename){
        set $rule_23 2$rule_23;
        }
        if ($rule_23 = "21"){
        rewrite ^/([a-zA-Z0-9-]+).([a-zA-Z0-9]+)
/index.php?task=view&name=$1 last;
        }
        if (!-f $request_filename){
        set $rule_24 1$rule_24;
        }
        if (!-d $request_filename){
        set $rule_24 2$rule_24;
        }
        if ($rule_24 = "21"){
        rewrite ^/([a-zA-Z0-9-]+)/([0-9]+)
/index.php?task=view&name=$1&user=$2 last;
        }
        if (!-f $request_filename){
        set $rule_25 1$rule_25;
        }
        if (!-d $request_filename){
        set $rule_25 2$rule_25;
        }
        if ($rule_25 = "21"){
        rewrite ^/([a-zA-Z0-9-]+) /index.php?task=view&name=$1 last;
        }


}

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,233008,233008#msg-233008
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.