2016-11-07 6 views
0

Ich versuche gerade, eine lokale dev-Maschine mit Docker einzurichten, mit nginx. Ich habe kürzlich von Virtualbox-Support auf Hyper-v gewechselt, und seitdem habe ich einen 403 Forbbiden in Nginx.403 Forbidden - Nginx, Docker & Windows

Ich folge dieser Anleitung zum Einrichten Dinge http://tech.osteel.me/posts/2015/12/18/from-vagrant-to-docker-how-to-use-docker-for-local-web-development.html

Meine Nginx Config ist wie folgt

server { 
    listen 80 default_server; 
    root /var/www/html; 
    index index.html index.php; 

    charset utf-8; 

    location/{ 
     try_files $uri $uri/ /index.php?$query_string; 
    } 

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

    access_log off; 
    error_log /var/log/nginx/error.log error; 

    sendfile off; 

    client_max_body_size 100m; 

    location ~ \.php$ { 
     fastcgi_split_path_info ^(.+\.php)(/.+)$; 
     fastcgi_pass php:9000; 
     fastcgi_index index.php; 
     include fastcgi_params; 
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
     fastcgi_intercept_errors off; 
     fastcgi_buffer_size 16k; 
     fastcgi_buffers 4 16k; 
    } 

    location ~ /\.ht { 
     deny all; 
    } 
} 

Und mein Docker-komponieren

nginx: 
    build: ./nginx/ 
    ports: 
     - 80:80 
    links: 
     - php 
    volumes_from: 
     - app 

php: 
    build: ./php/ 
    expose: 
     - 9000 
    links: 
     - mysql 
    volumes_from: 
     - app 

app: 
    image: php:7.0-fpm 
    volumes: 
     - ~/docker:/var/www/html 
     #also tried .:/var/www/html 
     #and ./docker:/var/www/html 
    command: "true" 

mysql: 
    image: mysql:latest 
    volumes_from: 
     - data 
    environment: 
     MYSQL_ROOT_PASSWORD: secret 
     MYSQL_DATABASE: project 
     MYSQL_USER: project 
     MYSQL_PASSWORD: project 

data: 
    image: mysql:latest 
    volumes: 
     - /var/lib/mysql 
    command: "true" 

phpmyadmin: 
    image: phpmyadmin/phpmyadmin 
    ports: 
     - 8080:80 
    links: 
     - mysql 
    environment: 
     PMA_HOST: mysql 

Docker Ordner im Inneren ist mein C:/Benutzer/docker

Was ' S die Aufholjagd hier? Danke

+0

Was ist in Ihrem NGINX logs ist? Es sollte ein prozessspezifisches Fehlerprotokoll und ein Zugriffsprotokoll geben, das Anfrage-/Antwortfehler ausgibt. '/ var/logs/nginx' sind der allgemeine Pfad für Protokolldateien. – Alan

+0

Anscheinend ist wie in der .conf-Datei konfiguriert 'access_log off; error_log /var/log/nginx/error.log Fehler; 'aber wenn ich ssh an docker-machine, sehe ich, dass/var/log hat nicht den Nginx-Ordner ... –

+0

Sind Sie als Docker Benutzer angemeldet? – R0MANARMY

Antwort

0

Eine stabile Dockerdatei und Bild ist auf dem Port von Docker Open Source zu Windows von WinDocks verfügbar. WinDocks läuft auf allen Editionen von Windows 8, 10, Server 2012 und 2016. Die Version 1.04 enthält Unterstützung für Tomcat, Jetty, Nginx und Node.js. Kostenlose Community Edition ist Here

Disclosure: Ich bin der Co-Founder von WinDocks