简体   繁体   English

如何使用nginx-fpm在Windows 10上使用DDEV创建虚拟主机?

[英]how to create a virtualhost with DDEV on windows 10 with nginx-fpm?

I would like to access my localdevelopment running on host/laptop with a mobile device. 我想通过移动设备访问在主机/笔记本电脑上运行的本地开发。

In the old days, when using a wampserver, I changed the apache virtualhost settings like something like this: 在过去,当使用wampserver时,我更改了apache虚拟主机设置,如下所示:

<VirtualHost *:80> ServerName vlokken.ltd ServerAlias vlokken.*.xip.io DocumentRoot c:/wamp/www/vlokken/web <Directory "c:/wamp/www/vlokken/web"> Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All require local Require ip 192.168.178.10 Require ip 192.168.178.19 </Directory> </VirtualHost

Is this also possible while using: 使用时也可以这样做:

  • DDEV v1.7.1 DDEV v1.7.1
  • Docker Desktop v2.0.0.3 Docker Desktop v2.0.0.3
  • Windows 10 Eduction Windows 10 Eduction

DDEV.config.yml: DDEV.config.yml:

APIVersion: v1.7.1 name: vlokken type: drupal8 docroot: web php_version: "7.3" webserver_type: nginx-fpm router_http_port: "80" router_https_port: "443" xdebug_enabled: false additional_hostnames: [] additional_fqdns: [] mariadb_version: "10.2" webcache_enabled: false nfs_mount_enabled: false provider: default

To answer your most direct question, I think you're asking "if using apache with ddev, how do I change the configuration", and the answer to that is in the docs: https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/#providing-custom-apache-configuration 为了回答你最直接的问题,我想你问“如果在ddev中使用apache,我该如何更改配置”,答案就在文档中: https//ddev.readthedocs.io/en/稳定/用户/扩展/定制-可扩展/#提供定制的Apache配置

But for accessing a local development environment from a mobile device, it's usually a little harder than just that, because the mobile device generally has no name resolution capabilities for a local network, or at least it's really difficult. 但是,为了从移动设备访问本地开发环境,它通常比仅仅更难,因为移动设备通常没有本地网络的名称解析功能,或者至少它真的很难。

This issue explains how to set up ngrok, which will proxy your local ddev project to an externally (mobile) available internet proxy location. 此问题说明了如何设置ngrok,它将本地ddev项目代理到外部(移动)可用的Internet代理位置。 Give it a try. 试试看。

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

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