我目前正在尝试使用nginx设置一个带有docker的本地开发机器。我最近从Virtualbox支持切换到Hyper-v,从那时起我在Nginx获得了403 Forbbiden。
我按照本教程设置了一些内容 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
Docker文件夹位于我的C:/ User / docker
中这里的追赶是什么? 感谢
答案 0 :(得分:-1)
WinDocks在Docker的Windows开源端口上提供了稳定的dockerfile和image。 WinDocks可在Windows 8,10,Server 2012和2016的所有版本上运行.1.04版本包括对Tomcat,Jetty,Nginx和Node.js的支持。免费社区版是Here
披露:我是WinDocks的联合创始人