当 ddev 配置为使用 apache 时,为什么我会看到 nginx headers?
Why do I see nginx headers when ddev is configured to use apache?
我将 ddev 更新到版本 1.3.0 和 运行 ddev config
。之后我将配置从 nginx-fpm
更改为 apache-fpm
。启动 ddev 并检查 HTTP headers 后,使用了 nginx/1.15.3。是否还有其他事情要做,让 Apache 正常工作?
我的config.yaml:
APIVersion: v1.3.0
name: example
type: typo3
docroot: public
php_version: "7.2"
webserver_type: apache-fpm
router_http_port: "8080"
router_https_port: "8443"
xdebug_enabled: true
additional_hostnames: []
additional_fqdns: []
provider: default
hooks:
post-start:
- exec: composer install -d /var/www/html
- exec: ../vendor/bin/typo3cms cache:flush
- exec: ../vendor/bin/typo3cms database:updateschema
- exec: yarn --cwd typo3conf/ext/theme/Resources/Private install
那是这样的好问题!我知道,因为我自己在编写测试时已经被它难倒了。
答案是:Apache 在 web 容器中运行,但是当你使用 http://*.ddev.local URL 时,它会通过 ddev-router,这是一个 nginx反向代理,这就是你看到 nginx headers 的原因。但请放心,您使用的是 Apache。您可以通过以下方式确认:
ddev ssh
和 ps -ef
看看什么是 运行
- 命中
ddev start
和 ddev describe
报告的 127.0.0.1 URL。 URL 直接进入 Web 容器,例如 http://127.0.0.1:33221 - 你会在那个上面看到 apache headers。
你的问题很好 - 你能把标题编辑成类似 "Why do I see nginx headers when ddev is configured to use apache?" 的东西吗 - 我想其他人会这样认为。
$ curl -I http://127.0.0.1:33224
HTTP/1.1 200 OK
Date: Fri, 12 Oct 2018 02:18:26 GMT
Server: Apache/2.4.25 (Debian)
Cache-Control: must-revalidate, no-cache, private
X-Drupal-Dynamic-Cache: HIT
X-UA-Compatible: IE=edge
Content-language: en
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Vary:
X-Generator: Drupal 8 (https://www.drupal.org)
X-Drupal-Cache: MISS
Content-Type: text/html; charset=UTF-8
我将 ddev 更新到版本 1.3.0 和 运行 ddev config
。之后我将配置从 nginx-fpm
更改为 apache-fpm
。启动 ddev 并检查 HTTP headers 后,使用了 nginx/1.15.3。是否还有其他事情要做,让 Apache 正常工作?
我的config.yaml:
APIVersion: v1.3.0
name: example
type: typo3
docroot: public
php_version: "7.2"
webserver_type: apache-fpm
router_http_port: "8080"
router_https_port: "8443"
xdebug_enabled: true
additional_hostnames: []
additional_fqdns: []
provider: default
hooks:
post-start:
- exec: composer install -d /var/www/html
- exec: ../vendor/bin/typo3cms cache:flush
- exec: ../vendor/bin/typo3cms database:updateschema
- exec: yarn --cwd typo3conf/ext/theme/Resources/Private install
那是这样的好问题!我知道,因为我自己在编写测试时已经被它难倒了。
答案是:Apache 在 web 容器中运行,但是当你使用 http://*.ddev.local URL 时,它会通过 ddev-router,这是一个 nginx反向代理,这就是你看到 nginx headers 的原因。但请放心,您使用的是 Apache。您可以通过以下方式确认:
ddev ssh
和ps -ef
看看什么是 运行- 命中
ddev start
和ddev describe
报告的 127.0.0.1 URL。 URL 直接进入 Web 容器,例如 http://127.0.0.1:33221 - 你会在那个上面看到 apache headers。
你的问题很好 - 你能把标题编辑成类似 "Why do I see nginx headers when ddev is configured to use apache?" 的东西吗 - 我想其他人会这样认为。
$ curl -I http://127.0.0.1:33224
HTTP/1.1 200 OK
Date: Fri, 12 Oct 2018 02:18:26 GMT
Server: Apache/2.4.25 (Debian)
Cache-Control: must-revalidate, no-cache, private
X-Drupal-Dynamic-Cache: HIT
X-UA-Compatible: IE=edge
Content-language: en
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Vary:
X-Generator: Drupal 8 (https://www.drupal.org)
X-Drupal-Cache: MISS
Content-Type: text/html; charset=UTF-8