Page 1 sur 1

[Nginx] Problème de configuration 404 not found (résolu)

Publié : ven. 25 oct. 2013, 19:17
par Armand01
Bonjour,

j'ai un serveur avec Nginx dessus, voila mon fichier de conf :

Code : Tout sélectionner

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

    sendfile        on;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   /www;
            index  index.html index.htm;
        }
	location /dl {
		root /downloads;
		autoindex on;
	}
    }
}
Mon problème est que quand je fais http://mon_serveur, j'ai bien ma page d'accueil comme je dois l'avoir (path sur le disque : /www/index.html). Mais quand je fais http://mon_serveur/dl pour afficher le contenu de /downloads (path sur le disque : /downloads) j'ai une 404 not found.
Habituellement j'utilise Apache mais le je voulais découvrir Nginx, donc c'est tout nouveau pour moi.

J'ai vérifié les permissions, tout est ok de ce point de vue, en même temps si ce n'était pas le cas je pense que j'aurai "403 Forbidden".

Merci d'avance pour votre aide :wink:

Armand.

Re: [Nginx] Problème de configuration 404 not found

Publié : ven. 25 oct. 2013, 22:21
par Armand01
Problème résolu :

Code : Tout sélectionner

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

    sendfile        on;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   /www;
            index  index.html index.htm;
        }
   location /dl {
      alias /downloads;
      autoindex on;
   }
    }
}