docksal / service-vhost-proxy

Virtual host proxy service image for Docksal
http://docksal.io
MIT License
7 stars 14 forks source link

Extended wildcard support for virtual host names #25

Open lmakarov opened 6 years ago

lmakarov commented 6 years ago

We currently support projects matching the following virtual host rules:

This is a proposal to support *.VIRTUAL_HOST.* wildcards (single and/or multi-value options).

nginx does not support this kind of wildcard, but does support regexp virtual hosts: http://nginx.org/en/docs/http/server_names.html For nginx, the virtual host would need to be defined as: ^(.+\.)?VIRTUAL_HOST_ESCAPED(\..+)?$

In proxyctl we will also have to make changes to the logic handling project lookup in the start() function.

Once implemented, this will simplify the sandboxing use case, as it will no longer be necessary to adjust project's VIRTUAL_HOST settings to add the base domain for the sandbox environments.