首页 > 解决方案 > DDEV prerelease on Mac M1 with docker tech preview doesn't work - docker broken

问题描述

I've been using DDEV for around 2 weeks with no issues using custom local domain names which was all working nicely until yesterday where one of my projects crashed.

Upon restarting DDEV, when trying to go to any custom local domain e.g dash.myproject.com, it results in a 500 nginx error.

If I go to ip address https://127.0.0.1:56248 My browser auto resolved to http:// and I get:

400 Bad Request
The plain HTTP request was sent to HTTPS port
nginx

If I manually update the ip address (https://127.0.0.1:56248) with the prefix https in the browser again, it brings back my local site.

My DDEV config for the project:

name: DashboardV2
type: laravel
docroot: public
php_version: "7.4"
webserver_type: nginx-fpm
router_http_port: "80"
router_https_port: "443"
xdebug_enabled: false
additional_hostnames:
- dash.myproject.local
additional_fqdns:
- dash.myproject.local
mariadb_version: "10.2"
mysql_version: ""
provider: default
use_dns_when_possible: false
composer_version: ""

Please would someone be able to help me resolve this?

I even get the same issue for new projects like I tried with the example project:

ddev poweroff && mkdir ~/tmp/testddev && cd ~/tmp/testddev && ddev config --project-type=php && ddev start

https://ddev.readthedocs.io/en/stable/users/troubleshooting/ (Added an index file for the above, resolves on 127.0.0.1:port but get 500 nginx error)

If I ddev logs, here are the results for the server, not seeing a 500 error reference though:

+ set -o errexit nounset pipefail
+ rm -f /tmp/healthy
+ DDEV_PHP_VERSION=7.4
+ DDEV_WEBSERVER_TYPE=nginx-fpm
+ '[' -n 7.4 ']'
+ update-alternatives --set php /usr/bin/php7.4
update-alternatives: using /usr/bin/php7.4 to provide /usr/bin/php (php) in manual mode
update-alternatives: warning: skip creation of /usr/share/man/man1/php.1.gz because associated file /usr/share/man/man1/php7.4.1.gz (of link group php) doesn't exist
+ ln -sf /usr/sbin/php-fpm7.4 /usr/sbin/php-fpm
+ export PHP_INI=/etc/php/7.4/fpm/php.ini
+ PHP_INI=/etc/php/7.4/fpm/php.ini
+ '[' '!' -z ']'
+ '[' -d /mnt/ddev_config/php ']'
+ '[' laravel = backdrop ']'
++ id -un
++ id -gn
+ printf '\nexport APACHE_RUN_USER=ryan\nexport APACHE_RUN_GROUP=dialout\n'
+ a2enmod access_compat alias auth_basic authn_core authn_file authz_core authz_host authz_user autoindex deflate dir env filter mime mpm_prefork negotiation reqtimeout rewrite setenvif status
Considering dependency authn_core for access_compat:
Module authn_core already enabled
Module access_compat already enabled
Module alias already enabled
Considering dependency authn_core for auth_basic:
Module authn_core already enabled
Module auth_basic already enabled
Module authn_core already enabled
Module authn_file already enabled
Module authz_core already enabled
Considering dependency authz_core for authz_host:
Module authz_core already enabled
Module authz_host already enabled
Considering dependency authz_core for authz_user:
Module authz_core already enabled
Module authz_user already enabled
Module autoindex already enabled
Considering dependency filter for deflate:
Module filter already enabled
Module deflate already enabled
Module dir already enabled
Module env already enabled
Module filter already enabled
Module mime already enabled
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Enabling module mpm_prefork.
Module negotiation already enabled
Module reqtimeout already enabled
Enabling module rewrite.
Module setenvif already enabled
Module status already enabled
To activate the new configuration, you need to run:
  service apache2 restart
+ a2enconf charset localized-error-pages other-vhosts-access-log security serve-cgi-bin
Conf charset already enabled
Conf localized-error-pages already enabled
Conf other-vhosts-access-log already enabled
Conf security already enabled
Conf serve-cgi-bin already enabled
+ '[' nginx-fpm = apache-fpm ']'
+ '[' false = true ']'
+ disable_xdebug
Disabled xdebug
+ ls /var/www/html
+ sudo mkdir -p /mnt/ddev-global-cache/terminus/cache /mnt/ddev-global-cache/ddev-live
+ sudo mkdir -p /mnt/ddev-global-cache/bashhistory/DashboardV2-web
++ id -u
++ id -g
+ sudo chown -R 501:20 /mnt/ddev-global-cache/ /home/ryan/.ssh /home/ryan/.drush /home/ryan/.gitconfig /home/ryan/.my.cnf
+ '[' -d /mnt/ddev_config/.homeadditions ']'
+ cp -r /mnt/ddev_config/.homeadditions/. /home/ryan/
+ '[' -d /mnt/ddev_config/homeadditions ']'
+ cp -r /mnt/ddev_config/homeadditions/. /home/ryan/
+ sudo mkdir -p /mnt/ddev-global-cache/mkcert
+ sudo chmod -R ugo+rw /mnt/ddev-global-cache/mkcert
+ mkcert -install
Using the local CA at "/mnt/ddev-global-cache/mkcert" ✨
The local CA is now installed in the system trust store! ⚡️

+ sudo CAROOT=/mnt/ddev-global-cache/mkcert mkcert -cert-file /etc/ssl/certs/master.crt -key-file /etc/ssl/certs/master.key dashboardv2.ddev.site dash.reviews.local dash.reviews.local.ddev.site localhost 127.0.0.1 127.0.0.1 web ddev-DashboardV2-web ddev-DashboardV2-web.ddev_default
Using the local CA at "/mnt/ddev-global-cache/mkcert" ✨

Created a new certificate valid for the following names 
 - "dashboardv2.ddev.site"
 - "dash.reviews.local"
 - "dash.reviews.local.ddev.site"
 - "localhost"
 - "127.0.0.1"
 - "127.0.0.1"
 - "web"
 - "ddev-DashboardV2-web"
 - "ddev-DashboardV2-web.ddev_default"

The certificate is at "/etc/ssl/certs/master.crt" and the key at "/etc/ssl/certs/master.key" ✅

+ sudo chown 501 /etc/ssl/certs/master.crt /etc/ssl/certs/master.key
Server started
+ echo 'Server started'
+ exec /usr/bin/supervisord -n -c /etc/supervisor/supervisord-nginx-fpm.conf
2021-03-26 13:31:15,767 INFO Included extra file "/etc/supervisor/php-fpm.conf" during parsing
2021-03-26 13:31:15,767 INFO Included extra file "/etc/supervisor/conf.d/mailhog.conf" during parsing
2021-03-26 13:31:15,767 INFO Included extra file "/etc/supervisor/conf.d/supervisor.conf" during parsing
2021-03-26 13:31:15,768 INFO supervisord started with pid 1
2021-03-26 13:31:16,775 INFO spawned: 'child_exit_monitor' with pid 1644
2021-03-26 13:31:16,776 INFO spawned: 'php-fpm' with pid 1645
2021-03-26 13:31:16,776 INFO spawned: 'nginx' with pid 1646
2021-03-26 13:31:16,777 INFO spawned: 'mailhog' with pid 1647
[26-Mar-2021 13:31:16] NOTICE: fpm is running, pid 1645
[26-Mar-2021 13:31:16] NOTICE: ready to handle connections
[26-Mar-2021 13:31:16] NOTICE: systemd monitor interval set to 10000ms
2021-03-26 13:31:17,812 INFO success: child_exit_monitor entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-03-26 13:31:17,812 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-03-26 13:31:17,812 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-03-26 13:31:17,812 INFO success: mailhog entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021/03/26 13:39:05 [info] 1652#1652: *20 client sent plain HTTP request to HTTPS port while reading client request headers, client: 172.18.0.1, server: _, request: "GET /login HTTP/1.1", host: "127.0.0.1:56248"
2021/03/26 13:39:05 [info] 1652#1652: *21 client sent plain HTTP request to HTTPS port while reading client request headers, client: 172.18.0.1, server: _, request: "GET /favicon.ico HTTP/1.1", host: "127.0.0.1:56248", referrer: "http://127.0.0.1:56248/login"
2021/03/26 13:40:03 [info] 1652#1652: *18 client timed out (110: Connection timed out) while waiting for request, client: 172.18.0.1, server: 0.0.0.0:443
2021/03/26 13:41:27 [info] 1652#1652: *31 client sent plain HTTP request to HTTPS port while reading client request headers, client: 172.18.0.1, server: _, request: "GET /login HTTP/1.1", host: "127.0.0.1:56248"
2021/03/26 13:41:27 [info] 1652#1652: *32 client sent plain HTTP request to HTTPS port while reading client request headers, client: 172.18.0.1, server: _, request: "GET /favicon.ico HTTP/1.1", host: "127.0.0.1:56248", referrer: "http://127.0.0.1:56248/login"

I am on MacOS m1 BigSur and Docker is running 3.3.0 (62029).

Please let me know if you need to see further information.

标签: phpmacosnginxsslddev

解决方案


Edit 2021-04-13: The current Docker Desktop Tech Preview for Apple M1 (RC3) works fine with ddev.


推荐阅读