简体   繁体   中英

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:

<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
  • Docker Desktop v2.0.0.3
  • Windows 10 Eduction

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

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. Give it a try.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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