Compare commits

..

No commits in common. "74f04d975c7f3109691e192fe3b9d3569ebdc1e3" and "54582d0f1d865fc74c21046991a80ae50b170942" have entirely different histories.

3 changed files with 2 additions and 59 deletions

View File

@ -9,20 +9,6 @@
enabled: yes enabled: yes
state: started state: started
- name: Create directory for error pages
file:
path: /var/www/errors
state: directory
owner: nginx
group: nginx
mode: '0755'
- name: Deploy custom error page
template:
src: site_down.html.j2
dest: /var/www/errors/site_down.html
mode: '0644'
- name: Deploy Proxy Configuration - name: Deploy Proxy Configuration
template: template:
src: proxy.conf.j2 src: proxy.conf.j2

View File

@ -1,6 +1,6 @@
upstream backend { upstream backend {
{% for server in upstream_servers %} {% for server in upstream_servers %}
server {{ server }} max_fails=1 fail_timeout=10s; server {{ server }} max_fails=1 fail_timeout=1s;
{% endfor %} {% endfor %}
} }
@ -12,20 +12,12 @@ server {
ssl_certificate /etc/nginx/ssl/{{ ssl_cert_file }}; ssl_certificate /etc/nginx/ssl/{{ ssl_cert_file }};
ssl_certificate_key /etc/nginx/ssl/{{ ssl_key_file }}; ssl_certificate_key /etc/nginx/ssl/{{ ssl_key_file }};
error_page 502 503 504 /site_down.html;
location = /site_down.html {
root /var/www/errors;
internal;
}
location / { location / {
proxy_pass http://backend; proxy_pass http://backend;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_intercept_errors on;
} }
location /health { location /health {

View File

@ -1,35 +0,0 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Сайт не работает</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f8d7da;
color: #721c24;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.message {
text-align: center;
}
h1 {
font-size: 48px;
margin-bottom: 20px;
}
p {
font-size: 18px;
}
</style>
</head>
<body>
<div class="message">
<h1>Сайт не работает</h1>
<p>Просьба обратиться в техподдержку или на сервере в данный момент техработы.</p>
</div>
</body>
</html>