Skip to content

Commit

Permalink
[infra] fix: maintenance page could not load static assets (#1826)
Browse files Browse the repository at this point in the history
  • Loading branch information
amatissart authored Nov 6, 2023
1 parent 13c2f6d commit 7893886
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions infra/ansible/roles/django/templates/tournesol.j2
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ server {

keepalive_timeout 5;

error_page 503 @503;
error_page 503 /maintenance/index.html;

location / {
{% if maintenance %}
Expand All @@ -36,18 +36,18 @@ server {
{% endif %}
}

location /maintenance {
alias /srv/maintenance;
try_files $uri =404;
}

location @index {
root /srv/tournesol-frontend;
sub_filter '__META_OG_IMAGE__' '$scheme://{{api_domain_name}}/preview$request_uri';
sub_filter '__META_OG_URL__' '$scheme://$server_name$request_uri';
try_files /index.html =404;
}

location @503 {
root /srv/maintenance;
try_files $uri /index.html =404;
}

{% if letsencrypt_email is defined %}
listen 443 ssl http2;
ssl_certificate /etc/letsencrypt/live/{{domain_name}}/fullchain.pem;
Expand Down
6 changes: 3 additions & 3 deletions infra/ansible/roles/nginx/files/maintenance/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
body {
margin: 0;
min-height: 100vh;
background-image: url('/chandelier.svg');
background-image: url('/maintenance/chandelier.svg');
background-repeat: repeat-x;
background-position: center top;
}
Expand All @@ -37,11 +37,11 @@
<body>
<div id="root">
<header>
<img src="/Logo.svg" />
<img src="/maintenance/Logo.svg" />
</header>
<main>
<h2 style="text-align: center; font-family: system-ui, sans-serif">Tournesol is currently under maintenance</h2>
<img src="/Watering.svg" width="280px"/>
<img src="/maintenance/Watering.svg" width="280px"/>
</main>
</div>
</body>
Expand Down

0 comments on commit 7893886

Please sign in to comment.