[nginx] file not found[Résolu]

Applications, problèmes de configuration réseau
elnk
newbie
Messages : 9
Inscription : mer. 03 juin 2015, 11:36

[nginx] file not found[Résolu]

Message par elnk »

Bonjour,

J'ai vu qu'il y avait déjà quelques réponses à ce sujet, mais je ne parviens pas régler mon soucis.
J'ai installer nginx et php-fpm et je ne parviens pas à afficher une page en .php. Le résultat que j'obtiens est : File not found. j'ai pourtant le sentiment
que tout est bien configuré.
Un petit coup de main serait le bien venu.
Voici mon fichier de conf nginx:

Code : Tout sélectionner

#user html;
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       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       8080;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            #root   /usr/share/nginx/html;
	    root  /srv/http; 
            index  index.php 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   /usr/share/nginx/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           /var/http;
            fastcgi_split_path_info ^(.+\.php)(.*)$;
	    #fastcgi_pass   127.0.0.1:9000;
            fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
	    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;
        #}
    }



}
Merci,
Dernière modification par elnk le sam. 10 sept. 2016, 18:10, modifié 1 fois.
Avatar de l’utilisateur
papajoke
Elfe
Messages : 820
Inscription : sam. 30 août 2014, 19:54

Re: [nginx] file not found

Message par papajoke »

bonjour,

il faudrait déjà regarder tes logs (dans journald) la réponse est dedans
cela a surement été écrit dans les sujets que tu as consulté, c'est l'unique moyen de se faire une idée du problème.

Code : Tout sélectionner

journalctl -b -t nginx -p3
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
tu vas donc chercher les fichiers php dans /scripts ?
perso j'ai une config comme : $document_root$fastcgi_script_name;
Arch stable - Kde 6 / fish - btrfs/mbr - Intel Core i3 - 6Go RAM - GeForce 405 video-nouveau
elnk
newbie
Messages : 9
Inscription : mer. 03 juin 2015, 11:36

Re: [nginx] file not found

Message par elnk »

En effet merci je n'avais pas bien compris le principe du fastcgi_param visiblement !
Répondre