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
How to best convert existing nginx config to ansible-role-nginx vars-model? #227
Comments
Hi @tobiasehlert! You are not wrong that there's no "Here's how to convert your NGINX conf to be used with this role" guides. I never even thought about having one! That being said, it would make sense to have a couple smallish sample configuration to role vars examples to at least set a starting point. For now, if you can't manage to get the templates working, I would recommend looking at the option to push your files using the https://github.com/nginxinc/ansible-role-nginx/blob/master/defaults/main/upload.yml options. You may need to tweak some of your |
Hi @alessfg, Well, I have come quite a bit in translating all my nginx configurations at all various places to work with this Ansible role.. so I will figure it out in the end. The files I find my things (even if it's not the easiest thing, are: But yeah.. some more documentation should be helpful for others, who are new to Ansible I think 😄 PS. do you want to keep the issue up or is it ok for you to close it? I think you've added an item to your todo list for this Best regards, |
Better to keep the issue open until I have some time to improve the docs 😄 |
Also having issues converting an existing config to use the templates ^^" What is the proper way to use "proxy_set_header" within "reverse_proxy"? I tried a lot of stuff, e.g.
and
and
and
but none of these worked. I'd appreciate a more detailed transition/overall documentation but would already be happy about a quick answer in here. ;) |
You can find an example here https://github.com/nginxinc/ansible-role-nginx/blob/master/molecule/common/playbook_template.yml#L108 When in doubt, molecule playbooks are always a good first place to check for working examples 😄 |
Thank you a lot! Maybe it would be helpful to put a small hint about the molecule examples into the readme, so other less experienced people, like me, get that quicker. ;) |
Yep definitely! I'll hopefully have something in place in the next few weeks 😁 |
Quick update -- I've added links to the various Molecule playbook examples to the README. I might still circle back to include more detailed examples showing how to port smallish sample NGINX configurations to the role template variables, but for the time being I'm going to the sample Molecule playbooks since those are always warranted to work with the current version of the role. |
What am I looking for?
Is there anywhere some documentation in how to convert existing nginx configurations to be able to deliver them by this role?
I would for example like to have an example how how to do this with this role.. I haven't been even close yet 😄
/etc/nginx/sites-available/example.com.conf
/etc/nginx/nginxconfig.io/php_fastcgi.conf
/etc/nginx/nginx.conf
/etc/nginx/nginxconfig.io/security.conf
/etc/nginx/nginxconfig.io/general.conf
I did generate those configs by using this tool:
https://www.digitalocean.com/community/tools/nginx#?0.domain=example.com&0.non_www=false&0.cert_type=custom&0.access_log_domain&0.error_log_domain&referrer_policy=origin-when-cross-origin
Best regards,
Tobias
The text was updated successfully, but these errors were encountered: