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

Allow configuration of nginx_ssl_directory #17

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Allow configuration of nginx_ssl_directory #17

wants to merge 11 commits into from

Conversation

cristoper
Copy link
Contributor

For my use case it will likely be convenient to be able to configure the directory where the SSL certificate/key is located (instead of hardcoding it to /etc/nginx/ssl). I have only very quickly tested this patch.

@nickjj
Copy link
Owner

nickjj commented Jan 30, 2018

Thanks for the contribution.

I am currently in the process of rewriting both this role and my let's encrypt role.

A configurable SSL location and multiple certificates (at the LE level) are on the list.

Going to keep this PR open as a reminder until they are both ready.

@cristoper
Copy link
Contributor Author

Cool (I just submitted a small PR to your LE role also). Both these Ansible roles have already saved me time, so I look forward to the improved versions!

Instead of hardcoding it to /etc/nginx/ssl
It doesn't make sense to have an upstream followed by =404. The
@upstream parameter must be the last parameter.

http://nginx.org/en/docs/http/ngx_http_core_module.html#try_files
When set to the name of an upstream, the direct_proxy variable causes
ALL requests to be proxied (so there is no try_file directive).

This is useful, for example, when proxying to a web server which handles
all static content or when the nginx reverse-proxy doesn't have access
to the origin server's root directory.

Example:

direct_proxy: apache
upstreams:
     - name: apache
       servers: ['apache_upstream_server']
For each entry in nginx_sites, create a file at
/etc/nginx/conf.d/common_ssl_site.domains[0].conf containing its SSL
configs, and include that in its main configuration files. This should
fix upstream Issue #15.

Also create /etc/nginx.conf.d/common_ssl_default.conf with the default
SSL settings. This is convenient for other vhosts -- including those not
managed by this role -- to be able to import.
I forgot everything in conf.d is included by the default nginx.conf
file. Better to keep our configurations separate.
I forgot the /etc/nginx/conf.d/ dir is included by the main nginx.conf
file. Store configuration snippets in our own directory (/etc/nginx/ansible-nginx-conf.d) instead.
For each entry in nginx_sites, create a file at
/etc/nginx/conf.d/common_ssl_site.domains[0].conf containing its SSL
configs, and include that in its main configuration files. This should
fix upstream Issue #15.

Also create /etc/nginx.conf.d/common_ssl_default.conf with the default
SSL settings. This is convenient for other vhosts -- including those not
managed by this role -- to be able to import.
nginx_main_directives works the same as nginx_http_directives but is
outside of http block.
n00b42 pushed a commit to n00b42/ansible-nginx that referenced this pull request Sep 13, 2022
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

Successfully merging this pull request may close these issues.

2 participants