繁体   English   中英

Docker - Nginx + PHP-FPM - 给出 502 错误

[英]Docker - Nginx + PHP-FPM - giving 502 error

我正在运行 POC 以在 docker 容器中使用 PHP-FPM FastCGI 在 Nginx 上托管 index.php。 我有 Nginx 的最低配置,但是当我运行curl -i http://localhost:8080时无法使其工作,它在 Nginx 日志中给出了以下类似的错误(注意:我只运行了 curl 命令一次):

127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
127.0.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET /index.php HTTP/1.0" 502 497 "-" "curl/7.29.0" "-"
172.17.0.1 - - [23/Jun/2022:19:24:29 +0000] "GET / HTTP/1.1" 502 497 "-" "curl/7.29.0" "-"
2022/06/23 19:30:05 [error] 12#12: *4085 open() "/usr/share/nginx/html/version" failed (2: No such file or directory), client: 172.17.0.1, server: localhost, request: "GET /version?timeout=32s HTTP/1.1", host: "localhost:8080"

Dockerfile

FROM nginx:stable-alpine

WORKDIR /usr/share/nginx/html

RUN apk update && apk upgrade
RUN apk add openrc php php-fpm

COPY index.php /usr/share/nginx/html/

# this is near to the default config provided by Nginx
COPY default.conf /etc/nginx/conf.d/

# entrypoint script runs php-fpm first then nginx
COPY entrypoint.sh entrypoint.sh

# copying this as I have made modifications to enable logs of php-fpm
COPY php-fpm.conf /etc/php8/php-fpm.conf

CMD ["sh", "entrypoint.sh"]

入口点.sh

#!/usr/bin/env sh
set -e

php-fpm8 -D
nginx -g 'daemon off;'

nginx.conf

server {
    listen       80;
    server_name  localhost;

    #access_log  /var/log/nginx/host.access.log  main;

    location / {
        root   /usr/share/nginx/html;
        index  index.php;
    }

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    location ~ \.php$ {
        proxy_pass   http://127.0.0.1;
    }

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$ {
        root           html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        include        fastcgi_params;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}

索引.php

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>PHP - Hello, World!</title>
</head>
<body>
        <h1><?php echo 'Hello, World!'; ?></h1>
</body>
</html>

我尝试使用chown -R nginx:nginx /usr/share/nginx/html向 /usr/share/nginx/html 提供授予 nginx 用户权限,但它也没有用。

最后,我正在使用以下命令构建和运行 docker:

docker build -t my-php .
docker run -d -p 8080:80 --name my-php my-php

我知道我在做一些非常基本的错误,但一直在努力解决这个问题,但找不到根本原因,日志也无济于事。

注意:是的,我希望 nginx 和 php-fpm 在同一个图像中,现在我不打算使用主管,因为我正在寻找当前问题的解决方案。

更新 1:

正如@Daniele Rugginenti 在评论中指出的那样,我在 nginx 中有一些错误配置,因此请求正在循环

---

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$ {
        root           html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        include        fastcgi_params;
    }

---

在评论第一部分之后,当再次尝试卷曲时,我得到以下回应:

HTTP/1.1 404 Not Found
Server: nginx/1.22.0
Date: Thu, 23 Jun 2022 21:10:23 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
X-Powered-By: PHP/8.0.20

File not found.

容器日志如下:

2022/06/23 21:10:23 [error] 13#13: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 172.17.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost:8080"
172.17.0.1 - - [23/Jun/2022:21:10:23 +0000] "GET / HTTP/1.1" 404 27 "-" "curl/7.29.0" "-"

最后一个错误通常与

script filename

路径错误

尝试使用默认配置:

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM