docker下nginx+php7.2

运行命令如下:
docker run -itd -p 9000:9000 -v D:/wwwroot/test/:/var/wwwroot/fym/ php:7.2-fpm /bin/bash
再看我nginx配置:
        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            #fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
            fastcgi_param SCRIPT_FILENAME /var/wwwroot/fym/$fastcgi_script_name;
            include        fastcgi_params;
        }
奶奶的,就报:
502 Bad Gateway
查看日志:
2020/02/04 16:56:59 [error] 30036#31316: *9050 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: t6.com, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "t6.com:8089"
最后进容器,手动启php-fpm.搞定
所以,什么都不想说了

 

你可能感兴趣的:(php)