2016-11-07 131 views
0

我目前正在嘗試使用nginx設置docker的本地開發機器。我最近從Virtualbox支持切換到Hyper-v,從那時起,我在Nginx中獲得了403 Forbbiden。403禁止 - Nginx,Docker和Windows

我下面這個教程設置的東西 http://tech.osteel.me/posts/2015/12/18/from-vagrant-to-docker-how-to-use-docker-for-local-web-development.html

我的Nginx的配置如下:

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; 
    } 
} 

我的碼頭工人,組成

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 

泊塢文件夾裏面是我的C:/ User/docker

What'在這裏追趕? 謝謝

+0

的共同創始人是什麼在你NGINX日誌?應該有一個特定於進程的錯誤日誌,以及一個寫出請求/響應錯誤的訪問日誌。 '/ var/logs/nginx'是日誌文件的通用路徑。 – Alan

+0

顯然是按照.conf文件配置'access_log off; error_log /var/log/nginx/error.log錯誤; '但是當我ssh到碼頭機,我看到/ var/log沒有nginx文件夾... –

+0

你是否以docker用戶登錄? – R0MANARMY

回答

0

一個穩定的dockerfile和鏡像可以在Docker的Windows開放源碼的端口上通過WinDocks獲得。 WinDocks在Windows 8,10,Server 2012和2016的所有版本上運行。1.04版本包括對Tomcat,Jetty,Nginx和Node.js的支持。免費社區版是Here

披露:我WinDocks