SteveLTN / https-portal

A fully automated HTTPS server powered by Nginx, Let's Encrypt and Docker.
MIT License
4.46k stars 295 forks source link

Allow per-domain config blocks #254

Closed MarcelWaldvogel closed 3 years ago

MarcelWaldvogel commented 3 years ago

Some configurations require different redirects or proxy settings for different locations. If the portal only handles a single domain/backend, this is usually no problem and can be handled with a CUSTOM_NGINX_SERVER_CONFIG_BLOCK. However, with multiple domains (the case where https-portal really excels), things get tricky.

Redirects can be handled with if constructs, which are [https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/](evil, inefficient, and buggy).

A notable case for complicated proxy settings is Collabora Online.

This extends the CUSTOM_NGINX_SERVER_CONFIG_BLOCK concept to per-domain config blocks. The contents of CUSTOM_NGINX_EXAMPLE_COM_CONFIG_BLOCK will be inserted just after the CUSTOM_NGINX_SERVER_CONFIG_BLOCK, but only in the configuration file for example.com.

SteveLTN commented 3 years ago

1.16.0 is released.