From 8f0c7479b96094c3ac3a6412a5f63703b5d755d6 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Mon, 13 Aug 2018 21:17:35 +0200 Subject: [PATCH] small fixes --- tasks/vhost.yml | 24 -------------- templates/etc/nginx/sites-available/vhost.j2 | 35 -------------------- 2 files changed, 59 deletions(-) delete mode 100644 tasks/vhost.yml delete mode 100644 templates/etc/nginx/sites-available/vhost.j2 diff --git a/tasks/vhost.yml b/tasks/vhost.yml deleted file mode 100644 index fd8d88a..0000000 --- a/tasks/vhost.yml +++ /dev/null @@ -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 diff --git a/templates/etc/nginx/sites-available/vhost.j2 b/templates/etc/nginx/sites-available/vhost.j2 deleted file mode 100644 index d9e61b1..0000000 --- a/templates/etc/nginx/sites-available/vhost.j2 +++ /dev/null @@ -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; -}