nginx/proxy: Made dependent on nginx/server and allowed additional directives

dehydrated
Felix Stupp 5 years ago
parent 92b98dd3fe
commit 8b75c49917
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -3,3 +3,4 @@
# domain: example.com
# backend_port: 12345 OR backend_socket: /example.socket
# upstream_name (optional)
additional_directives: ""

@ -3,6 +3,8 @@
allow_duplicates: yes
dependencies:
- role: acme/certificate
- role: nginx/upstream
# upstream_name
- role: nginx/server
# domain
# directives

@ -1,10 +0,0 @@
---
- name: Configure proxy for {{ domain }} to {{ backend_port is defined | ternary(backend_port, backend_socket) }}
template:
src: proxy.conf
dest: "{{ nginx_sites_directory }}/{{ domain }}"
owner: root
group: root
mode: "u=rw,g=r,o=r"
notify: reload nginx

@ -1,14 +1,7 @@
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name {{ domain }};
---
ssl on;
ssl_certificate {{ acme_certificate_location }};
ssl_certificate_key {{ acme_key_location }};
include {{ nginx_snippets_directory }}/https;
include {{ nginx_snippets_directory }}/global;
directives: |
{{ additional_directives }}
location / {
proxy_pass http://{{ upstream_name }};
@ -22,4 +15,3 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Loading…
Cancel
Save