-
Notifications
You must be signed in to change notification settings - Fork 419
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
Parameters sorted incorrectly inside nginx.conf #40
Comments
cc: @cheuschober |
@TaiSHiNet, Thanks for the report. |
@TaiSHiNet, Could you share your pillar? I thought the nginx pieces accept lists of dicts; is this your main nginx.conf? We might have to change the data structure at https://github.com/saltstack-formulas/nginx-formula/blob/master/nginx/ng/map.jinja#L44 to an |
init.sls
cache.sls
Right now they're separated but I played with them on the same config and changing line position, tried naming one before the other on the pillar top |
Hrm. I know I solved this for my team but I'm away from my work computer. Will have to leave it for the weekend then I can see what's up. In either case I'm thinking I might re-do the templating there anyway -- the two template files are so similar I might as well combine them and ensure the same data construction/serialization that works well for vhost config also works for the main nginx.conf. |
Hit me up whenever you want on weekdays, I'll gladly drop tests for you on my env |
Any news on this? |
Haven't forgotten about it and am absolutely committed to fixing but just have had a couple weeks worth of other work drop in my lap. |
Offering a double /hug for a fix :) |
I just hit the same issue with I could solve it by moving |
+1 for this issue. From my perspective it is impossible to configure an upstream proxy because the vhost is always included before the cache_path or the cache directive is printed before the cache_path. |
My current workaround is creating a vhost called 000-whatever, but I'd love to have this fixed |
I also made a workaround which works for me: https://github.com/kurt---/nginx-formula/tree/enable-proxy it works by adding a proxy.conf-configuration-file which is inserted before the proxy_cache-directive. The config-file enables the cache (and logging-option) and one can enable the cache if desired. to enable the additional access-log one need to put these into the vhost-config else we ran into the same problem with options in the wrong order. So this is not a fix but it works for me to enable a proxy in nginx. |
This is crap but configuration for http scope cannot be both ordered and merged from map.jinja it seems, see issue saltstack-formulas#40.
Is this still broken? |
@outime This is specifically for the ng formula as far as I'm aware, are you using that portion? |
@gravyboat it still broken only @EvaSDK workaround works. |
This is crap but configuration for http scope cannot be both ordered and merged from map.jinja it seems, see issue saltstack-formulas#40.
@EvaSDK thanks, for this, I now it doesn't look nice but it works. |
yeah, I hope someone finds a better workaround but at least it gets it working for some use cases. |
This also affects setting the logging format as well. Due to log_format being defined in the config after access_log. |
Adding sort_keys=False to json() allows nginx.server.config to be sorted as needed for the resulting config file to work with access_log+log_format (issue saltstack-formulas#102) and other parameters (issue saltstack-formulas#40)
And this is back again with nginx loadable module support landing in Debian. |
Another occurence of the declarations sorting problem from issue saltstack-formulas#40. It will contain instructions that must be executed first on Debian.
Another occurence of the declarations sorting problem from issue saltstack-formulas#40. It will contain instructions that must be executed first on Debian.
This is definitely causing a problem in Ubuntu for me. We are using the streaming module for TCP load balancing in a few of our environments.
making sure this is on the first (or nearly first) line of the nginx configuration, because without it the This reared its ugly head tonight, because we rebased with your repo, and the hacky customization got missed in the internal pull request on our saltstack repo. Any chance this use case could be handled? |
I have self-resolved on my end, by pushing the needed configuration into the pillar data. It works now by adding another include to the pillar:
|
See: saltstack/salt#12161 |
Currently I'm suffering an issue due to contents being sorted with includes first:
Given that I'm trying to use cache, this makes my configuration fail (vhost is loaded before cache is defined)
The text was updated successfully, but these errors were encountered: