small fixes

This commit is contained in:
Robert Kaussow 2018-08-13 21:17:35 +02:00
parent 767b26c3b1
commit 8f0c7479b9
2 changed files with 0 additions and 59 deletions

View File

@ -1,24 +0,0 @@
---
- block:
- name: Add default page configuration file
template:
src: etc/nginx/sites-available/vhost.j2
dest: "/etc/nginx/sites-available/{{ item.key }}"
owner: root
group: root
mode: 0640
with_dict: nginx_vhosts
notify: __nginx_reload
- name: Enable default page
file:
src: "/etc/nginx/sites-available/{{ item.key }}"
dest: "/etc/nginx/sites-enabled/{{ item.key }}"
owner: root
group: root
state: link
with_dict: nginx_vhosts
notify: __nginx_reload
when: nginx_vhosts is defined
become: True
become_user: root

View File

@ -1,35 +0,0 @@
#jinja2: lstrip_blocks: True
# {{ ansible_managed }}
{% if item.value.proxy_server is defined %}
upstream backends {
{% for server in item.value.proxy_server %}
server {{ server }};
{% endfor %}
}
{% endif %}
server {
listen 80;
server_name {{ item.value.server_name }};
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name {{ item.value.server_name }};
location / {
proxy_pass https://backends;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
ssl_certificate /etc/pki/tls/certs/le-rknet.pem;
ssl_certificate_key /etc/pki/tls/private/le-rknet.pem;
}