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

Fix nginx.conf with TLS verification #13

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions imageroot/templates/nginx.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ stream {
listen 127.0.0.1:{{ item.listen_port }};

proxy_ssl {{ 'on' if item.tls == '1' else 'off' }};
proxy_ssl_verify {{ 'on' if item.tls_verify == '1' else 'off' }};
{%- if item.tls_verify == '1' %}
proxy_ssl_verify on;
proxy_ssl_verify_depth {{ item.tls_verify_depth | default('2') }};
proxy_ssl_trusted_certificate /etc/ssl/certs/ca-certificates.crt;
proxy_ssl_name {{ (item.servers|first).host }};
{%- endif %}
}
upstream {{ item.domain | replace('.', '_') }} {
{%- for server in item.servers %}
{%- for server in ([item.servers[0]] if item.tls_verify == '1' else item.servers) %}
server {{ server.host + ':' + server.port + (' backup' if not server.is_local and not loop.index0 == 0 else '') }}; # origin {{ server.origin }}
{%- endfor %}
}
Expand Down
Loading