gpt4 book ai didi

docker - 1#1 : pread() "/etc/nginx/conf.d/default.conf" failed (38: Function not implemented)

转载 作者:行者123 更新时间:2023-12-02 18:34:29 29 4
gpt4 key购买 nike

在编码时,我的“Docker 容器”崩溃了好几次。查看日志,这是它向我显示的内容:

[crit] 1#1: pread() "/etc/nginx/conf.d/default.conf" failed (38: Function not implemented)

这是 Docker-compose 配置和 nginx 的 default.conf :

docker-compose.yml:

version:  '3.7'
services:
mariadb:
image: ${MARIADB_VERSION}
restart: on-failure
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
ports:
- ${PORTS_MARIADB}
volumes:
- sql-data:/var/lib/mysql
#user: 1000:1000
php:
build:
context: .
dockerfile: docker/php/Dockerfile
volumes:
- './app/:/usr/src/app'
restart: on-failure
user: 1000:1000
environment:
APP_ENV: dev
APP_DEBUG: 1
SECRET: ddezde2z3dea12da21azd23adz1
DB_USER: ff
DB_PWD: fezfezfezfezfze
DB_NAME: ff
DB_VER: mariadb-10.4.12
DB_PORT: 3306
nginx:
image: ${NGINX_VERSION}
restart: on-failure
volumes:
- './app/public/:/usr/src/app'
- './docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro'
ports:
- ${PORTS_NGINX}
depends_on:
- php
volumes:
sql-data:

默认配置文件(nginx):

    server {
server_name ~.*;

location / {
root /usr/src/app;

# try to serve file directly, fallback to index.php
try_files $uri /index.php$is_args$args;
}

# optionally disable falling back to PHP script for the asset directories;
# nginx will return a 404 error when files are not found instead of passing the
# request to Symfony (improves performance but Symfony's 404 page is not displayed)
# location /bundles {
# try_files $uri =404;
# }

location ~ ^/index\.php(/|$) {
client_max_body_size 50m;

fastcgi_pass php:9000;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /usr/src/app/public/index.php;
}

# return 404 for all other php files not matching the front controller
# this prevents access to other php files you don't want to be accessible.
location ~ \.php$ {
return 404;
}

error_log /var/log/nginx/project_error.log;
access_log /var/log/nginx/project_access.log;
}

我不知道为什么我得到这个并且..我需要重新启动 docker 以使容器再次工作。

有什么想法吗?问候

最佳答案

如果您使用的是 Docker for Windows,尤其是像我一样的最新“稳定版”(2.3.0.3),您可以尝试使用边缘版本的 Docker Desktop 作为 suggested here by stephen-turner .或者你可以像 diogoaguiar 这样降级建议。

关于docker - 1#1 : pread() "/etc/nginx/conf.d/default.conf" failed (38: Function not implemented),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61944649/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com