从昨天开始,我有一个“ 502 Bad Gateway nginx / 1.13.12”。我不知道该如何解决该问题。我在docker上使用API平台2.2.5,周一一切正常。我当时在做项目的反应部分(前部分),而没有接触php部分。
我不是真正的开发人员,我是心脏病专家,所以请放纵
我在localhost中。这是docker-compose配置:
version: '3.4'
services:
php:
image: ${CONTAINER_REGISTRY_BASE}/php
build:
context: ./api
target: api_platform_php
cache_from:
- ${CONTAINER_REGISTRY_BASE}/php
depends_on:
- db
env_file:
- ./api/.env
# Comment out these volumes in production
volumes:
- ./api:/srv/api:rw,cached
# If you develop on Linux, uncomment the following line to use a bind-mounted host directory instead
# - ./api/var:/srv/api/var:rw
api:
image: ${CONTAINER_REGISTRY_BASE}/nginx
build:
context: ./api
target: api_platform_nginx
cache_from:
- ${CONTAINER_REGISTRY_BASE}/nginx
depends_on:
- php
# Comment out this volume in production
volumes:
- ./api/public:/srv/api/public:ro
ports:
- "8081:80"
cache-proxy:
image: ${CONTAINER_REGISTRY_BASE}/varnish
build:
context: ./api
target: api_platform_varnish
cache_from:
- ${CONTAINER_REGISTRY_BASE}/varnish
depends_on:
- api
volumes:
- ./api/docker/varnish/conf:/usr/local/etc/varnish:ro
ports:
- "8081:80"
db:
# In production, you may want to use a managed database service
image: postgres:9.6-alpine
environment:
- POSTGRES_DB=api
- POSTGRES_USER=api-platform
# You should definitely change the password in production
- POSTGRES_PASSWORD=!ChangeMe!
volumes:
- db-data:/var/lib/postgresql/data:rw
# You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./docker/db/data:/var/lib/postgresql/data:rw
ports:
- "5432:5432"
client:
# Use a static website hosting service in production
# See https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#deployment
image: ${CONTAINER_REGISTRY_BASE}/client
build:
context: ./client
cache_from:
- ${CONTAINER_REGISTRY_BASE}/client
env_file:
- ./client/.env
volumes:
- ./client:/usr/src/client:rw,cached
- /usr/src/client/node_modules
ports:
- "80:3000"
admin:
# Use a static website hosting service in production
# See https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#deployment
image: ${CONTAINER_REGISTRY_BASE}/admin
build:
context: ./admin
cache_from:
- ${CONTAINER_REGISTRY_BASE}/admin
env_file:
- ./admin/.env
volumes:
- ./admin:/usr/src/admin:rw,cached
- /usr/src/admin/node_modules
ports:
- "81:3000"
h2-proxy:
# Don't use this proxy in prod
build:
context: ./h2-proxy
depends_on:
- client
- admin
- api
- cache-proxy
ports:
- "443:443"
- "444:444"
- "8443:8443"
- "8444:8444"
volumes:
db-data: {}
这是“ docker ps -a”
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b8afc6d88f5c apiplatform225_h2-proxy "nginx -g 'daemon of…" 2 hours ago Up 2 hours 0.0.0.0:443-444->443-444/tcp, 80/tcp, 0.0.0.0:8443-8444->8443-8444/tcp apiplatform225_h2-proxy_1
d27a612304f0 quay.io/api-platform/varnish "docker-app-start" 2 hours ago Exited (255) 2 hours ago apiplatform225_cache-proxy_1
edcc73e05921 quay.io/api-platform/nginx "nginx -g 'daemon of…" 2 hours ago Up 2 hours 0.0.0.0:8082->80/tcp apiplatform225_api_1
ee7b51f67258 postgres:9.6-alpine "docker-entrypoint.s…" 2 hours ago Created apiplatform230_db_1
0caf11454e02 quay.io/api-platform/client "/bin/sh -c 'yarn st…" 2 hours ago Created apiplatform230_client_1
9006a7666a5c quay.io/api-platform/admin "/bin/sh -c 'yarn st…" 2 hours ago Created apiplatform230_admin_1
280c7ffd16e9 quay.io/api-platform/php "docker-entrypoint p…" 2 hours ago Exited (2) 2 hours ago apiplatform225_php_1
0b49a51052a3 postgres:9.6-alpine "docker-entrypoint.s…" 2 hours ago Up 2 hours 0.0.0.0:5432->5432/tcp apiplatform225_db_1
184992869a9e fhirbase/fhirbase "/usr/lib/postgresql…" 2 months ago Created fhirbase
682bf87a0fc5 3e44013e9186 "/bin/sh -c 'apt-get…" 2 months ago Exited (100) 2 months ago blissful_pasteur
940f8855a5bb quay.io/api-platform/client "/bin/sh -c 'yarn st…" 2 months ago Up 2 hours 0.0.0.0:82->3000/tcp apiplatform225_client_1
9cadfc1382c4 nginx "nginx -g 'daemon of…" 2 months ago Created serene_minsky
12f21ccb34b7 nginx "nginx -g 'daemon of…" 2 months ago Created test-nginx
37ebd4a37d22 quay.io/api-platform/admin "/bin/sh -c 'yarn st…" 2 months ago Up 2 hours 0.0.0.0:81->3000/tcp apiplatform225_admin_1
d9bfd09120ab apiplatform_app "docker-app-entrypoi…" 8 months ago Exited (0) 8 months ago apiplatform_app_1
1881c977d54a apiplatform_nginx "nginx -g 'daemon of…" 8 months ago Created apiplatform_nginx_1
e243b33c5ca3 apiplatform_db "docker-entrypoint.s…" 8 months ago Exited (0) 8 months ago apiplatform_db_1
e4825a696db2 apiplatform211_varnish "docker-app-start" 9 months ago Exited (137) 8 months ago apiplatform211_varnish_1
a5175efdbc0e apiplatform211_app "docker-app-entrypoi…" 9 months ago Exited (0) 8 months ago apiplatform211_app_1
2ac32603ceec apiplatform211_nginx "nginx -g 'daemon of…" 9 months ago Exited (0) 8 months ago apiplatform211_nginx_1
17a6943dfe70 apiplatform211_db "docker-entrypoint.s…" 9 months ago Exited (0) 8 months ago apiplatform211_db_1
我在计算机上重新启动了docker,并启动了“ docker-compose up -d”,但它没有任何改变。
这是新的“ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c18810c582dc api-platform-225_h2-proxy "nginx -g 'daemon of…" 58 seconds ago Up 55 seconds 0.0.0.0:443-444->443-444/tcp, 80/tcp, 0.0.0.0:8443-8444->8443-8444/tcp api-platform-225_h2-proxy_1
e7c71d0a2b48 quay.io/api-platform/varnish "docker-app-start" 59 seconds ago Exited (255) 55 seconds ago api-platform-225_cache-proxy_1
dd609020d56a quay.io/api-platform/nginx "nginx -g 'daemon of…" About a minute ago Up 58 seconds 0.0.0.0:8082->80/tcp api-platform-225_api_1
698223caf6e7 quay.io/api-platform/php "docker-entrypoint p…" About a minute ago Exited (2) 58 seconds ago api-platform-225_php_1
d309a24a9a8b quay.io/api-platform/client "/bin/sh -c 'yarn st…" About a minute ago Up About a minute 0.0.0.0:82->3000/tcp api-platform-225_client_1
96a5d6510aa2 postgres:9.6-alpine "docker-entrypoint.s…" About a minute ago Up About a minute 0.0.0.0:5432->5432/tcp api-platform-225_db_1
f2899db1ec25 quay.io/api-platform/admin "/bin/sh -c 'yarn st…" About a minute ago Up About a minute 0.0.0.0:81->3000/tcp api-platform-225_admin_1
ee7b51f67258 postgres:9.6-alpine "docker-entrypoint.s…" 21 hours ago Created apiplatform230_db_1
0caf11454e02 quay.io/api-platform/client "/bin/sh -c 'yarn st…" 21 hours ago Created apiplatform230_client_1
9006a7666a5c quay.io/api-platform/admin "/bin/sh -c 'yarn st…" 21 hours ago Created apiplatform230_admin_1
184992869a9e fhirbase/fhirbase "/usr/lib/postgresql…" 2 months ago Created fhirbase
682bf87a0fc5 3e44013e9186 "/bin/sh -c 'apt-get…" 2 months ago Exited (100) 2 months ago blissful_pasteur
9cadfc1382c4 nginx "nginx -g 'daemon of…" 2 months ago Created serene_minsky
12f21ccb34b7 nginx "nginx -g 'daemon of…" 2 months ago Created test-nginx
d9bfd09120ab apiplatform_app "docker-app-entrypoi…" 8 months ago Exited (0) 8 months ago apiplatform_app_1
1881c977d54a apiplatform_nginx "nginx -g 'daemon of…" 8 months ago Created apiplatform_nginx_1
e243b33c5ca3 apiplatform_db "docker-entrypoint.s…" 8 months ago Exited (0) 8 months ago apiplatform_db_1
e4825a696db2 apiplatform211_varnish "docker-app-start" 9 months ago Exited (137) 8 months ago apiplatform211_varnish_1
a5175efdbc0e apiplatform211_app "docker-app-entrypoi…" 9 months ago Exited (0) 8 months ago apiplatform211_app_1
2ac32603ceec apiplatform211_nginx "nginx -g 'daemon of…" 9 months ago Exited (0) 8 months ago apiplatform211_nginx_1
17a6943dfe70 apiplatform211_db "docker-entrypoint.s…" 9 months ago Exited (0) 8 months ago apiplatform211_db_1
如果我的php代码有问题,如何在没有symfony调试栏的情况下找到它?