Ceci est mon docker-compose.ymldocker-Compose avec nginx ne fonctionne pas
version: '2'
services:
nginx:
image: nginx:1.11.8-alpine
ports:
- "8081:80"
volumes:
- ./code:/usr/share/nginx/html
- ./html:/myapp
- ./site.conf:/etc/nginx/conf.d/site.conf
- ./error.log:/var/log/nginx/error.log
- ./nginx.conf:/etc/nginx/nginx.conf
Et c'est site.conf
server {
listen 8081;
index index.html index.php;
server_name localhost;
error_log /var/log/nginx/error.log;
location /html {
root /myapp;
}
}
http://nginx-php-docker.local:8081/ Il est un travail, un fichier index.html montrant l'intérieur/code dossier
Mais il ne fonctionne pas avec http://nginx-php-docker.local:8081/html
E le journal du journal est: 2017/01/13 08:50:27 [erreur] 7 # 7: * 4 open() "/ usr/share/nginx/html/html" a échoué (2: aucun fichier ou répertoire de ce type), client: 172.19.0.1, serveur: localhost, requête: "GET/html HTTP/1.1", hôte: "nginx-php-docker.local: 8081"
Veuillez me dire où je me trompe.
Comment ressemble votre nginx.conf? – rckrd
@rckrd Il est très simple https://gist.github.com/anhducbkhn/21f2a35db1d9dfb5cbe089f658e36c3f –