Bonjour,
Slt je suis sous Jessie j'utilise nginx 1.10.2 mon vhost se trouve dans /etc/nginx/default.conf
voici ce que j'ai essayer de bricoler dans mon vhost pour pouvoir accéder à plusieurs sites
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
location / {
#root /usr/share/nginx/html;
root /home/emitic/webstation/emiticgroup/www;
index 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 /home/emitic/webstation/emiticgroup/www;
# fastcgi_pass 127.0.0.1:9000;
try_files $uri = 404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$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;
#}
}
server {
listen 80;
server_name localhost/adminer;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
location /adminer {
#root /usr/share/nginx/html;
root /usr/share/adminer;
index index.html index.htm index.php;
}
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 /usr/share/adminer;
# fastcgi_pass 127.0.0.1:9000;
try_files $uri = 404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$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;
#}
}
J'arrive à acceder au localhost sans probleme quand jessaie http://localhost/adminer je tombe sur ma page d'érreur
Salut,
Je ne connais pas bien Nginx, mais sur Apache2, il faut créer plusieurs VHosts, chacun correspondant à un projet (ou site comme tu appelles ça). Je pense que tu devrais commencer par regarder de ce côté là.
oui c'est ce que j'ai au tout debut il y avait default.conf et quand j'ai créer adminer.conf les configurations de default.conf ne passait plus c-a-d quand je faisait http://localhost cela tombait sur ma page d'érreur mais quand c'était http://localhost/adminer j'accédais au site san problème donc je me suis dis si les configurations se trouvaient sur le default.conf cela pourraient fonctionner et ce que j'ai fais. Maintenant c'est http://localhost qui passe et http://localhost/adminer qui ne passe pas
Bonjour,
personnellement, je rajouterais une ligne dans mon fichier /etc/hosts pour que adminer pointe sur 127.0.0.1
ensuite il suffit de dupliquer la config default et d'utiliser le nom d'hôte adminer à la place de localhost et changer le root.
L'url serait directement http://adminer/