Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to override parts of nginx config rather the whole config #16

Open
apotek opened this issue Mar 8, 2023 · 0 comments
Open

Ability to override parts of nginx config rather the whole config #16

apotek opened this issue Mar 8, 2023 · 0 comments

Comments

@apotek
Copy link

apotek commented Mar 8, 2023

Background

I posted the following question in Lando slack:

Hi. I need to add some headers to my nginx server (specifically the Allowed* headers). I checked the Lando nginx services docs, and it appears there is no support for a pattern like:

myservice:
  type: nginx
  overrides:
    - nginx_config_var: my_value

And instead the docs indicate: “You may need to override our default nginx config with your own custom server, vhosts or fastcgi_params config.” And there are only options for server, vhosts, params, with no options for additional configs.

  myservice:
    type: nginx
    config:
      server: .lando/config/nginx/my_custom_server.conf

This of course means I would have to duplicate the entire nginx server config.

Is there really no way to override parts of the config? With mysql, for example, I can include a config file to add certain parameters I need rather than override the default config. Is there a better pattern than copy+pasting the shipping nginx server config, modifying it, and then mounting it to the service container?

Considering how common it is to need to modify Allowed headers (especially for development), I must be missing something obvious.

The Request

Be able to add nginx server config without having to override the whole file. Two patterns I have seen elsewhere (Platform SH) for example, and Lando:

Overrides Pattern:

  myservice:
    type: nginx
    config_overrides:
      nginx_var_name: my_value

Include Pattern (like Lando mysql service):

  myservice:
    type: nginx
    config: path/to/my/custom.conf

Where the custom.conf is not the entire server conf file, but just modifications to it, like when apache allows you do include a directory of additional configs etc.

@apotek apotek changed the title Ability to override parts of config rather the whole config Ability to override parts of nginx config rather the whole config Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant