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

Config file discovery doesn't work with nested folders #133

Open
lucsoft opened this issue Aug 3, 2022 · 7 comments
Open

Config file discovery doesn't work with nested folders #133

lucsoft opened this issue Aug 3, 2022 · 7 comments

Comments

@lucsoft
Copy link

lucsoft commented Aug 3, 2022

i have a nested setup in user_conf.d/

But only top level conf files are getting recognize.

@JonasAlfredsson
Copy link
Owner

JonasAlfredsson commented Aug 3, 2022

That is true, the loops looks like this:

for conf_file in /etc/nginx/conf.d/*.conf*; do
done

and

while   ; do
done < <(find /etc/nginx/user_conf.d/ -maxdepth 1 -type f -print0)

So it will only do one level. I have not heard of anyone doing multiple layers until now, so if possible could you please explain your usecase a bit more so I can get a better understanding of the feature request?

@lucsoft
Copy link
Author

lucsoft commented Aug 4, 2022

my setup looks something like this

user_conf.d/
      group_a/
            a.conf
            b.conf
            c.conf
      group_b/
            a.conf
            b.conf
            c.conf
      group_c/
            a.conf
            b.conf
            c.conf

Its more for organization not any technical reason or something

@JonasAlfredsson
Copy link
Owner

Alright, I am a little bit busy with another project right now so if you feel adventurous I do accept pull requests, otherwise I will take a look at this when I am done with the other stuff :)

@joshlopes
Copy link

I'm facing this same issue right now -- I was trying to work around but sadly no luck -- has anyone made any progress with this ?

@lucsoft
Copy link
Author

lucsoft commented Jun 1, 2024

maybe something like Caddy could also be nice as its way simpler and has Lets Encrypt build in. I switched to Kubernetes and CertManager so yeah but caddy also good :D

@joshlopes
Copy link

I think I tried Caddy a while ago, I have weird configuration forwarding requests to different ports on different servers -- I wasn't able to make it work.

@JonasAlfredsson
Copy link
Owner

JonasAlfredsson commented Jun 3, 2024

Yeah, Nginx config files aren't super easy to write, but I still greatly prefer its configurability compared to the Caddyfile format.

This is still a low priority issue, but I spent a couple of hours assembling this experimental commit: cf12cad

Try it out and see if it works :) (WARNING: this is basically untested, so feedback is appreciated)

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

3 participants