Remove unnecessary templates

This commit is contained in:
Alex Kotov 2021-09-19 00:52:29 +05:00
parent 4269d57158
commit 81bca59152
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
6 changed files with 1 additions and 163 deletions

View file

@ -63,7 +63,7 @@
- name: Add Nginx sites
notify: nginx | Restart Nginx
template:
src: 'templates/nginx/{{ item.type }}.conf'
content: '{{ item.content }}'
dest: '{{ nginx__available_dir }}/{{ item.domain }}.conf'
mode: 'u=rw,go=r'
owner: root

View file

@ -1,27 +0,0 @@
server {
listen 80;
listen [::]:80;
server_name {{ item.domain }};
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name {{ item.domain }};
ssl_certificate {{ item.cert }};
ssl_certificate_key {{ item.key }};
include {{ item.ssl_conf }};
root {{ item.root }};
try_files $uri $uri/ =404;
charset utf-8;
autoindex on;
}

View file

@ -1,53 +0,0 @@
server {
listen 80;
listen [::]:80;
server_name {{ item.domain }};
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name {{ item.domain }};
ssl_certificate {{ item.cert }};
ssl_certificate_key {{ item.key }};
include {{ item.ssl_conf }};
root {{ item.root }};
try_files $uri/index.html $uri @origin;
location @origin {
proxy_cache_bypass $http_upgrade;
proxy_http_version 1.1;
proxy_redirect off;
{% if item.external %}
proxy_set_header Connection "upgrade";
proxy_set_header HOST $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
{% else %}
proxy_set_header Connection "upgrade";
proxy_set_header HOST $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
{% endif %}
proxy_pass http://{{ item.upstream }};
}
error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
}

View file

@ -1,59 +0,0 @@
server {
listen 80;
listen [::]:80;
server_name {{ item.domain }};
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name {{ item.domain }};
ssl_certificate {{ item.cert }};
ssl_certificate_key {{ item.key }};
include {{ item.ssl_conf }};
ssl_verify_client optional;
ssl_client_certificate {{ item.clnt_ca }};
proxy_cache_bypass $http_upgrade;
proxy_http_version 1.1;
proxy_redirect off;
proxy_set_header Connection "upgrade";
proxy_set_header HOST $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
location / {
recursive_error_pages on;
error_page 418 = @no_crt;
error_page 419 = @with_crt;
if ($ssl_client_verify != SUCCESS) {
return 418;
}
if ($ssl_client_verify = SUCCESS) {
return 419;
}
}
location @no_crt {
proxy_pass https://{{ item.no_crt }};
}
location @with_crt {
proxy_pass https://{{ item.with_crt }};
}
}

View file

@ -1 +0,0 @@
{{ item.content }}

View file

@ -1,22 +0,0 @@
server {
listen 80;
listen [::]:80;
server_name {{ item.domain }};
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name {{ item.domain }};
ssl_certificate {{ item.cert }};
ssl_certificate_key {{ item.key }};
include {{ item.ssl_conf }};
return 301 https://{{ item.redir_to }}$request_uri;
}