2017-11-01 4 views
0

iはLEMPは、ローカルのWeb開発のためのドッキングウィンドウ-構成とスタックを作成したいが、私はいくつかのトラブルに持っている:docker-composeでLEMPスタックを作成する方法は?私が書いた...</p> <p>設定ファイルを

ドッキングウィンドウ-compose.yml

nginx: 
     image: nginx:latest 
     ports: 
       - "8080:80" 
     volumes: 
       - ./web:/web 
       - ./mysite.template:/etc/nginx/conf.d/mysite.template 
     links: 
       - php 
     command: /bin/bash -c "envsubst </etc/nginx/conf.d/mysite.template> /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'" 
php: 
     image: php:7-fpm 
     volumes: 
       - ./web:/web 

mysite.template

server { 
     listen 80; 
     root /web; 
     index index.php index.html; 
     server_name default_server; 

    location ~ \.php$ { 
     fastcgi_pass php:9000; 
     fastcgi_index index.php; 
     include fastcgi_params; 
     fastcgi_param SCRIPT_FILENAME /web$fastcgi_script_name; 
     } 
} 

問題は、私が開こうとするとhttp://localhost:8080結果は、私はそれを修正するにはどうすればよい

を拒否されましたアクセスであるということですか?

EDIT:
これは、nginxのコンテナのエラーログです:

nginx_1 | 2017/11/01 13:21:25 [error] 8#8: *1 FastCGI sent in stderr: "Access to the script '/web' has been denied (see security.limit_extensions)" while reading response header from upstream 
+0

私のために働きました。 'web/index.html'を作成しましたか? – pinny87

+0

@ pinny87ええ、それはhtmlで動作しますが、PHPコードでは動作しません...私は単純な '<?php phpinfo();を試しました。 ?> 'しかしそれは私にアクセスが拒否されたことを示します – zDoes

答えて

0

私はあなたの例では、にごdocker-compose.ymlを変更して動作させることができました:あなたが持っているコードを使用

nginx: 
     image: nginx:latest 
     ports: 
       - "8080:80" 
     volumes: 
       - ./web:/web 
       - ./mysite.template:/etc/nginx/conf.d/default.conf 
     links: 
       - php 
php: 
     image: php:7-fpm 
     volumes: 
       - ./web:/web 
+0

それは、ありがとう、たくさん働いています! – zDoes

関連する問題

 関連する問題