lando / nginx

The Official NGINX Lando Plugin
https://docs.lando.dev/nginx/
GNU General Public License v3.0
6 stars 6 forks source link

Broken vhost template rendering in latest release #39

Closed neclimdul closed 9 months ago

neclimdul commented 10 months ago

From slack I was pointed to changes in the render template tooling. I was actually relying on that to build custom vhost for our environment and that's now broken.

Specifically, each vhost contains a line like this using the LANDO_APP_COMMON_NAME environment variable to resolve the correct common name at compile time.

server_name "backstop.{{LANDO_APP_COMMON_NAME}}.lndo.site";

This is useful because I have a clean release management version of the project and a often broken development version of the project with different lando names in a .lando.local.yml file and this correctly handled resolving the domain.

neclimdul commented 10 months ago

I see the problem now and I think its a road I've been down before because I've got a solution of sorts in one of my nginx containers.

In the containers I was using it in I was able to use envsubst as a quick stand in. It does a very similar thing as a more unixy tool. But despite this being a standard gettext cli tool, a quick look at the the bitnami container shows it is not available. I assume could lead to some whack-a-mole guessing at what variables users need and additional sed lines. :(

pirog commented 9 months ago

@neclimdul check out this example for replacing server_name with an envvar https://github.com/lando/nginx/blob/main/examples/custom/.lando.yml#L11

will roll another release with this soonish

neclimdul commented 9 months ago

@pirog looked through the merge request and it all makes sense. config looks good!