saltstack-formulas / nginx-formula

Nginx Salt Formula
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
163 stars 421 forks source link

[BUG] How to set internal property on pillar? #279

Closed thomasrossetto closed 3 years ago

thomasrossetto commented 3 years ago

Hi, I want to use Internal declaration (http://nginx.org/en/docs/http/ngx_http_core_module.html#internal) into my nginx configuration pillar, but I don't know how to write it.

Do you have some ideas?

Thanks!

myii commented 3 years ago

@thomasrossetto One definite suggestion would be to use TOFS, which has has been enabled for this formula as well in #238. Or the simpler method of using source_path is still available. There might be a way of defining directly in pillar but I haven't tried doing that -- the general move has been towards allowing end users to provide their own custom templates instead (i.e. TOFS or source_path mentioned above).

javierbertoli commented 3 years ago

@thomasrossetto sorry if I got late to help. If you already solved it, I'll leave this example here for future reference.

This

mysite.conf:
  enabled: true
  config:
    - server:
        - server_name: my-site
        ...
        ...
        - location = /404.html:
            - internal: ''
}

will add a section like the one you're linking to.

The rationale the configuration template macro follows is:

For your particular request, making the value assignment an empty string gives you the result you expect.